Skip to content

Commit c1a4eab

Browse files
committed
Fix merge queue checks by ensuring consistent job names across events
GitHub has a known bug where PRs that are up-to-date with the target branch may trigger fast-forward merges. When this happens, GitHub looks for check statuses on the PR commit instead of triggering merge_group workflows. Previously, claude-code-test.yml had different job names for PR vs merge_group events: - pr-check: ran on pull_request - validate-generation: ran only on merge_group - claude-code-e2e: ran only on merge_group When GitHub's fast-forward optimization kicked in, it couldn't find validate-generation or claude-code-e2e checks on the PR commit because those jobs never ran for PRs. Fix: Make validate-generation and claude-code-e2e run on BOTH events, with step-level conditions to skip actual work on PRs. This ensures the check names exist for PRs, working around GitHub's merge queue bug. See: https://github.com/orgs/community/discussions/151100
1 parent b6bc46b commit c1a4eab

1 file changed

Lines changed: 22 additions & 12 deletions

File tree

.github/workflows/claude-code-test.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,39 +28,42 @@ permissions:
2828
contents: read
2929

3030
jobs:
31-
# Job for PRs - always passes, actual validation happens in merge queue
32-
pr-check:
33-
runs-on: ubuntu-latest
34-
if: github.event_name == 'pull_request'
35-
steps:
36-
- name: PR Check
37-
run: echo "Claude Code integration tests will run in the merge queue"
38-
3931
# Job 1: Validate command generation from fixtures (no API key needed)
40-
# Runs on merge_group and workflow_dispatch only
32+
# Runs on all events, but actual work only happens in merge_group/workflow_dispatch
33+
# This ensures the check name exists for PRs (needed for GitHub's merge queue)
4134
validate-generation:
4235
runs-on: ubuntu-latest
43-
if: github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
4436
steps:
37+
# For PRs: just pass quickly (actual tests run in merge queue)
38+
- name: Skip on PR
39+
if: github.event_name == 'pull_request'
40+
run: echo "Validation will run in merge queue. Passing for PR."
41+
4542
- uses: actions/checkout@v4
43+
if: github.event_name != 'pull_request'
4644

4745
- name: Install uv
46+
if: github.event_name != 'pull_request'
4847
uses: astral-sh/setup-uv@v4
4948
with:
5049
version: "latest"
5150

5251
- name: Set up Python
52+
if: github.event_name != 'pull_request'
5353
uses: actions/setup-python@v5
5454
with:
5555
python-version: "3.11"
5656

5757
- name: Install dependencies
58+
if: github.event_name != 'pull_request'
5859
run: uv sync --extra dev
5960

6061
- name: Run fruits workflow tests
62+
if: github.event_name != 'pull_request'
6163
run: uv run pytest tests/integration/test_fruits_workflow.py -v
6264

6365
- name: Generate commands and validate structure
66+
if: github.event_name != 'pull_request'
6467
run: |
6568
# Create a test environment
6669
mkdir -p test_project/.deepwork/jobs
@@ -100,17 +103,24 @@ jobs:
100103
101104
# Job 2: Full end-to-end test with Claude Code
102105
# Tests the COMPLETE workflow: define job -> implement -> execute
103-
# Runs on merge_group and workflow_dispatch, skipped on PRs (shows as passing check)
106+
# Runs on all events, but actual work only happens in merge_group/workflow_dispatch
107+
# This ensures the check name exists for PRs (needed for GitHub's merge queue)
104108
claude-code-e2e:
105109
runs-on: ubuntu-latest
106110
needs: validate-generation
107-
if: github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
108111
env:
109112
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
110113
steps:
114+
# For PRs: just pass quickly (actual tests run in merge queue)
115+
- name: Skip on PR
116+
if: github.event_name == 'pull_request'
117+
run: echo "E2E tests will run in merge queue. Passing for PR."
118+
111119
- uses: actions/checkout@v4
120+
if: github.event_name != 'pull_request'
112121

113122
- name: Check for API key
123+
if: github.event_name != 'pull_request'
114124
id: check-key
115125
run: |
116126
if [ -z "$ANTHROPIC_API_KEY" ]; then

0 commit comments

Comments
 (0)