Skip to content

Commit c875fb9

Browse files
authored
fix(deploy-queue): generate job url in a separate step (#74)
* fix(deploy-queue): generate job url in a separate step * chore(deploy-queue): bump version to 0.7.2 * fix(deploy-queue): addressing PR comment - added INPUT_URL to env * fix(deploy-queue): extract inputs.url to variable
1 parent ba6f035 commit c875fb9

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

deploy-queue/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy-queue/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "deploy-queue"
3-
version = "0.7.1"
3+
version = "0.7.2"
44
edition = "2024"
55

66
[dependencies]

deploy-queue/action.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ runs:
102102
ARCHIVE: "deploy-queue-${{ steps.triple.outputs.triple }}"
103103
ACTION_REPO: ${{ github.action_repository || github.repository }}
104104

105+
- name: Determine deployment URL
106+
id: deployment-url
107+
if: inputs.mode == 'start'
108+
shell: bash
109+
env:
110+
INPUT_URL: ${{ inputs.url }}
111+
run: |
112+
if [[ -n "${INPUT_URL}" ]]; then
113+
echo "url=${INPUT_URL}" >> "$GITHUB_OUTPUT"
114+
else
115+
echo "url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ job.check_run_id }}" >> "$GITHUB_OUTPUT"
116+
fi
117+
105118
- name: Run deploy-queue
106119
id: run-deploy-queue
107120
shell: bash
@@ -114,11 +127,10 @@ runs:
114127
COMPONENT: ${{ inputs.component }}
115128
VERSION: ${{ inputs.version }}
116129
CONCURRENCY_KEY: ${{ inputs.concurrency-key }}
117-
URL: ${{ inputs.url }}
130+
URL: ${{ steps.deployment-url.outputs.url }}
118131
NOTE: ${{ inputs.note }}
119132
DEPLOYMENT_ID: ${{ inputs.deployment-id }}
120133
CANCELLATION_NOTE: ${{ inputs.cancellation-note }}
121-
GITHUB_JOB_RUN_ID: ${{ job.check_run_id }}
122134
run: |
123135
set -euo pipefail
124136
@@ -144,11 +156,8 @@ runs:
144156
args+=("--version" "${VERSION}")
145157
fi
146158
147-
# Use provided URL or generate GitHub Actions URL as fallback
148159
if [[ -n "${URL:-}" ]]; then
149160
args+=("--url" "${URL}")
150-
else
151-
args+=("--url" "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/job/${GITHUB_JOB_RUN_ID}")
152161
fi
153162
154163
if [[ -n "${NOTE:-}" ]]; then
@@ -248,7 +257,7 @@ runs:
248257
"elements": [
249258
{
250259
"type": "mrkdwn",
251-
"text": ":github: <${{ inputs.url }}|View GitHub Actions Job>"
260+
"text": ":github: <${{ steps.deployment-url.outputs.url }}|View GitHub Actions Job>"
252261
}
253262
]
254263
},

0 commit comments

Comments
 (0)