Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/update-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
bun update --latest "$package"
fi
done
- name: Close existing PRs
run: |
gh pr list --repo ${{ github.repository }} --state open --author "tscircuitbot" --json number,title --jq '.[] | select(.title | startswith("chore:")) | .number' | xargs -I{} gh pr close {} --comment "Closing in favor of a new update PR"
Comment on lines +38 to +40
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Authenticate gh before closing existing PRs

The new Close existing PRs step invokes gh pr close without exporting GH_TOKEN or GITHUB_TOKEN with write permissions. When a previous bot PR exists, this call will run with the default token (read‑only in most workflows) and gh fails with HTTP 403: Resource not accessible by integration, stopping the whole job before it can create the new update PR. The subsequent merge step already sets GH_TOKEN to secrets.TSCIRCUIT_BOT_GITHUB_TOKEN; this step needs the same treatment to reliably close PRs.

Useful? React with 👍 / 👎.

- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v5
Expand Down
Loading