Skip to content

Commit cf4689a

Browse files
committed
fix(ci): include commit SHA in fallback E2E label-help comment
When the workflow runs lookup returns no specific run id, the comment now tells the maintainer to find the run by commit SHA on the workflow page instead of just linking to the all-runs page with no further guidance. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 35d6b1c commit cf4689a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/e2e-label-help.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ jobs:
5656
run_id=$(gh api "repos/$GH_REPO/actions/workflows/$workflow_file/runs?head_sha=$PR_HEAD_SHA&event=push" \
5757
--jq '.workflow_runs | sort_by(.created_at) | reverse | .[0].id // empty')
5858
if [ -n "$run_id" ]; then
59-
run_link="[the existing run](https://github.com/$GH_REPO/actions/runs/$run_id)"
59+
instructions="Open [the existing run](https://github.com/$GH_REPO/actions/runs/$run_id) and click **Re-run all jobs** to execute with the label set."
6060
else
61-
run_link="[$workflow_name](https://github.com/$GH_REPO/actions/workflows/$workflow_file)"
61+
workflow_link="[$workflow_name](https://github.com/$GH_REPO/actions/workflows/$workflow_file)"
62+
instructions="Open $workflow_link, find the run for commit \`$short_pr\`, and click **Re-run all jobs** to execute with the label set."
6263
fi
63-
body="Label \`$LABEL_NAME\` applied for \`$short_pr\`. Open $run_link and click **Re-run all jobs** to execute with the label set. The \`E2E Gate\` check on this PR will flip green automatically once the run finishes."
64+
body="Label \`$LABEL_NAME\` applied for \`$short_pr\`. $instructions The \`E2E Gate\` check on this PR will flip green automatically once the run finishes."
6465
fi
6566
6667
gh pr comment "$PR_NUMBER" --body "$body"

0 commit comments

Comments
 (0)