From 5052fc8d6b515d05424eb58744709a2bb5313c52 Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Mon, 16 Mar 2026 23:14:13 +0000 Subject: [PATCH] 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 --- .github/actions/issue-auto-implement/action.yml | 15 +++++++++++++++ .github/workflows/issue-auto-implement-test.yml | 4 ---- .github/workflows/issue-auto-implement.yml | 1 + .github/workflows/test.yml | 2 ++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/actions/issue-auto-implement/action.yml b/.github/actions/issue-auto-implement/action.yml index ff4866ee..cb14adaf 100644 --- a/.github/actions/issue-auto-implement/action.yml +++ b/.github/actions/issue-auto-implement/action.yml @@ -272,6 +272,7 @@ runs: GITHUB_TOKEN: ${{ inputs.github_token }} REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.pull_request.number }} + HEAD_REF: ${{ github.event.pull_request.head.ref }} run: | BODY="Addressed review feedback. New commit(s) pushed; verification passed." curl -s -X POST \ @@ -280,6 +281,13 @@ runs: "https://api.github.com/repos/$REPO/issues/$PR_NUMBER/comments" \ -d "$(jq -n --arg b "$BODY" '{body: $b}')" echo "Posted comment on PR #$PR_NUMBER" + # Trigger test workflow so checks appear on the updated PR + curl -s -X POST \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/$REPO/actions/workflows/test.yml/dispatches" \ + -d "$(jq -n --arg ref "$HEAD_REF" '{ref: $ref}')" + echo "Triggered test workflow on ref $HEAD_REF" - name: Create PR 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' shell: bash @@ -320,3 +328,10 @@ runs: echo "Posted comment on issue #$ISSUE_NUMBER" fi fi + # Trigger test workflow on this branch so CI checks appear (PRs created by github-actions[bot] often don't trigger pull_request) + curl -s -X POST \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/$REPO/actions/workflows/test.yml/dispatches" \ + -d "$(jq -n --arg ref "$BRANCH" '{ref: $ref}')" + echo "Triggered test workflow on ref $BRANCH" diff --git a/.github/workflows/issue-auto-implement-test.yml b/.github/workflows/issue-auto-implement-test.yml index e5c670d0..04ae6733 100644 --- a/.github/workflows/issue-auto-implement-test.yml +++ b/.github/workflows/issue-auto-implement-test.yml @@ -4,12 +4,8 @@ name: Issue auto-implement (assess tests) on: pull_request: branches: [main] - paths: - - '.github/actions/issue-auto-implement/**' push: branches: [main] - paths: - - '.github/actions/issue-auto-implement/**' jobs: assess: diff --git a/.github/workflows/issue-auto-implement.yml b/.github/workflows/issue-auto-implement.yml index 0f579a04..0a2735cb 100644 --- a/.github/workflows/issue-auto-implement.yml +++ b/.github/workflows/issue-auto-implement.yml @@ -26,6 +26,7 @@ jobs: contents: write issues: write pull-requests: write + actions: write # trigger test workflow on PR branch so checks appear (PRs created by bot may not trigger pull_request) # read:org only needed if using team check (AUTO_IMPLEMENT_ALLOWED_TRIGGER_TEAM) steps: - name: Checkout diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 36a84e07..acdf4dab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,8 @@ on: pull_request: branches: - main + # Allow triggering CI on a branch (e.g. after auto-implement creates a PR, so checks appear) + workflow_dispatch: {} jobs: unit-test: