Skip to content

fix(core): pass --ref to gh workflow run in tagger dispatch#3

Merged
yasha-dev1 merged 1 commit intomainfrom
fix/harnext-fix-tagger
Apr 26, 2026
Merged

fix(core): pass --ref to gh workflow run in tagger dispatch#3
yasha-dev1 merged 1 commit intomainfrom
fix/harnext-fix-tagger

Conversation

@yasha-dev1
Copy link
Copy Markdown
Collaborator

Summary

  • The generated harnext-tagger.yml calls gh workflow run to dispatch the first pipeline stage, but its job only grants issues: write + actions: write. Without --ref, the gh CLI resolves the default branch via GraphQL (repository.defaultBranchRef), which requires contents: read. On a fresh install this fails with "Resource not accessible by integration" and the entire pipeline never starts (observed on QualityUnit/flowhunt-amicited issue #35, run 24951902826).
  • Fix: pass --ref "${{ github.event.repository.default_branch }}" so gh skips the default-branch lookup. The branch is in the issues event payload for free, so no permission expansion is needed.
  • Added a regression test that locks the --ref flag in.

Test plan

  • npm test — all 317 tests pass
  • npm run typecheck — clean
  • Re-run setup wizard on a fresh repo and verify the first issue triggers the triage stage

🤖 Generated with Claude Code

The tagger job grants issues:write + actions:write but not contents:read.
Without --ref, gh CLI resolves the default branch via GraphQL
(repository.defaultBranchRef), which fails with "Resource not accessible
by integration" — the entire pipeline never starts on a fresh install.

Sourcing the branch from github.event.repository.default_branch keeps
the token scope minimal.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@yasha-dev1 yasha-dev1 merged commit 9a356a1 into main Apr 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant