Skip to content

Commit 5052fc8

Browse files
committed
fix: trigger test workflow after auto-implement creates/updates PR
PRs created by github-actions[bot] often do not trigger pull_request workflows, so the Checks tab shows 0 checks. After creating or updating a PR, explicitly dispatch the test workflow on the PR branch so CI runs and checks appear. - Add workflow_dispatch to test.yml - Grant actions: write in issue-auto-implement workflow - Trigger test workflow in Create PR step and in Comment on PR (review) step Made-with: Cursor
1 parent b403cd2 commit 5052fc8

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/actions/issue-auto-implement/action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ runs:
272272
GITHUB_TOKEN: ${{ inputs.github_token }}
273273
REPO: ${{ github.repository }}
274274
PR_NUMBER: ${{ github.event.pull_request.number }}
275+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
275276
run: |
276277
BODY="Addressed review feedback. New commit(s) pushed; verification passed."
277278
curl -s -X POST \
@@ -280,6 +281,13 @@ runs:
280281
"https://api.github.com/repos/$REPO/issues/$PR_NUMBER/comments" \
281282
-d "$(jq -n --arg b "$BODY" '{body: $b}')"
282283
echo "Posted comment on PR #$PR_NUMBER"
284+
# Trigger test workflow so checks appear on the updated PR
285+
curl -s -X POST \
286+
-H "Authorization: Bearer $GITHUB_TOKEN" \
287+
-H "Accept: application/vnd.github+json" \
288+
"https://api.github.com/repos/$REPO/actions/workflows/test.yml/dispatches" \
289+
-d "$(jq -n --arg ref "$HEAD_REF" '{ref: $ref}')"
290+
echo "Triggered test workflow on ref $HEAD_REF"
283291
- name: Create PR
284292
if: steps.assess.outputs.action == 'implement' && steps.implement_verify_loop.outcome == 'success' && github.event_name != 'pull_request_review' && github.event_name != 'pull_request_review_comment'
285293
shell: bash
@@ -320,3 +328,10 @@ runs:
320328
echo "Posted comment on issue #$ISSUE_NUMBER"
321329
fi
322330
fi
331+
# Trigger test workflow on this branch so CI checks appear (PRs created by github-actions[bot] often don't trigger pull_request)
332+
curl -s -X POST \
333+
-H "Authorization: Bearer $GITHUB_TOKEN" \
334+
-H "Accept: application/vnd.github+json" \
335+
"https://api.github.com/repos/$REPO/actions/workflows/test.yml/dispatches" \
336+
-d "$(jq -n --arg ref "$BRANCH" '{ref: $ref}')"
337+
echo "Triggered test workflow on ref $BRANCH"

.github/workflows/issue-auto-implement-test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ name: Issue auto-implement (assess tests)
44
on:
55
pull_request:
66
branches: [main]
7-
paths:
8-
- '.github/actions/issue-auto-implement/**'
97
push:
108
branches: [main]
11-
paths:
12-
- '.github/actions/issue-auto-implement/**'
139

1410
jobs:
1511
assess:

.github/workflows/issue-auto-implement.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
contents: write
2727
issues: write
2828
pull-requests: write
29+
actions: write # trigger test workflow on PR branch so checks appear (PRs created by bot may not trigger pull_request)
2930
# read:org only needed if using team check (AUTO_IMPLEMENT_ALLOWED_TRIGGER_TEAM)
3031
steps:
3132
- name: Checkout

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
pull_request:
99
branches:
1010
- main
11+
# Allow triggering CI on a branch (e.g. after auto-implement creates a PR, so checks appear)
12+
workflow_dispatch: {}
1113

1214
jobs:
1315
unit-test:

0 commit comments

Comments
 (0)