Skip to content

Commit b978380

Browse files
Feed open PRs to challenge creation workflow to prevent duplicates (#197)
The daily challenge creation cron could create challenges with the same number or topic as existing open PRs. This adds a step that fetches all open PRs via `gh pr list` and injects them into Claude's prompt so it can avoid conflicts. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0578315 commit b978380

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/create-challenge.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ jobs:
3232
pip install pre-commit requests websocket-client
3333
pre-commit install
3434
35+
- name: Fetch open PRs
36+
id: open-prs
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
run: |
40+
{
41+
echo "open_prs<<OPEN_PRS_EOF"
42+
gh pr list --state open --json number,title,headRefName --template '{{range .}}PR #{{.number}}: {{.title}} (branch: {{.headRefName}}){{"\n"}}{{end}}'
43+
echo "OPEN_PRS_EOF"
44+
} >> "$GITHUB_OUTPUT"
45+
3546
- name: Run Claude Code
3647
id: claude
3748
uses: anthropics/claude-code-action@v1
@@ -55,9 +66,17 @@ jobs:
5566
5667
Before writing any code, think hard about what would make a genuinely interesting GPU programming challenge. List existing challenges (ls challenges/*/), study what's already covered, and brainstorm problems that would teach people something new about GPU programming.
5768
69+
IMPORTANT — CHECK FOR CONFLICTS WITH OPEN PRs:
70+
The following open PRs already exist. You MUST avoid picking a challenge number or topic that conflicts with any of these:
71+
72+
${{ steps.open-prs.outputs.open_prs }}
73+
74+
Pick the next available challenge number that is NOT already taken by a merged challenge or an open PR. Also avoid creating a challenge on the same topic as any pending PR, even if the number differs.
75+
5876
HARD RULES:
5977
- Do NOT create trivial element-wise challenges. We have way too many (sigmoid, relu, silu, clipping, etc). If your idea is just "apply f(x) to every element", pick something else.
60-
- Do NOT duplicate existing challenges.
78+
- Do NOT duplicate existing challenges — check both the merged challenges in the repo AND the open PRs listed above.
79+
- Do NOT use a challenge number that is already claimed by an open PR.
6180
- Prefer medium or hard difficulty. Only create easy if the topic involves a non-trivial GPU concept (not just a map operation).
6281
- The challenge should require the solver to think about memory access patterns, synchronization, work distribution, or algorithm design — not just write a one-line kernel.
6382

0 commit comments

Comments
 (0)