Skip to content

Commit c2e1868

Browse files
dcramerclaude
andcommitted
fix(ci): handle workflow_dispatch in fork PR permission checks
Inverted the condition logic to properly handle all event types: - push → runs (not a pull_request) - workflow_dispatch → runs (not a pull_request) - pull_request from same repo → runs (fork check passes) - pull_request from fork → skips (no write permissions) The previous approach explicitly listed 'push' which missed workflow_dispatch. The new approach skips only fork PRs, allowing all other events through. Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent e86d11d commit c2e1868

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎.github/workflows/eval.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ jobs:
6464

6565
- name: Create eval status check
6666
uses: actions/github-script@v7
67-
# Skip for fork PRs (no write permissions) but still run for pushes and same-repo PRs
68-
if: ${{ !cancelled() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) }}
67+
# Skip for fork PRs (no write permissions) but still run for pushes, workflow_dispatch, and same-repo PRs
68+
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
6969
continue-on-error: true # Don't fail workflow if check creation fails
7070
with:
7171
script: |

‎.github/workflows/token-cost.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
- name: Create check run
165165
uses: actions/github-script@v7
166166
# Skip for fork PRs (no write permissions) but still run for pushes and same-repo PRs
167-
if: ${{ always() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) }}
167+
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
168168
continue-on-error: true # Don't fail workflow if check creation fails
169169
with:
170170
script: |

0 commit comments

Comments
 (0)