Skip to content

Commit 77cbd9e

Browse files
committed
Fix test label comment workflow
1 parent 015bdde commit 77cbd9e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/comment-on-test-label.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Comment on test-* label
22

3-
# Posts a reminder when a `test openj9` / `test windows` label is added,
3+
# Posts a notice when a `test openj9` / `test windows` label is added,
44
# explaining that `build-pull-request.yml` doesn't retrigger on `labeled`
55
# events (see the design notes at the top of that file for the rationale).
6-
# Without this, applying the label and waiting would look broken.
6+
# This is conditional because labels can also be present when the PR is first
7+
# opened, in which case the initial build should already see them.
78
#
89
# Why `pull_request_target` is safe here: this workflow does NOT check out
910
# or execute any PR code. Its only step is `gh pr comment`. Fork PRs
@@ -31,4 +32,4 @@ jobs:
3132
PR_NUMBER: ${{ github.event.pull_request.number }}
3233
LABEL: ${{ github.event.label.name }}
3334
run: |
34-
gh pr comment "$PR_NUMBER" --body "The \`$LABEL\` label has been added, but the build only consults test-* labels at the moments it naturally runs (PR opened / synchronize / reopened). To pick up this label, push another commit or close-and-reopen the PR."
35+
gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "The \`$LABEL\` label is present on this PR. If it was added after the PR's current build started, that build will not pick it up because test-* labels are only read when the build naturally runs (PR opened / synchronize / reopened). Push another commit or close and reopen the PR to run with this label."

0 commit comments

Comments
 (0)