Skip to content

build(ci): hand the weekly refresh PR off through a tracking issue - #405

Merged
avner-m merged 1 commit into
masterfrom
ci/deps-refresh-ci-token
Nov 9, 2026
Merged

avner-m merged 1 commit into
masterfrom
ci/deps-refresh-ci-token

Conversation

@avner-m

@avner-m avner-m commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What

The weekly dependency refresh now hands its PR off through a tracking issue instead of opening the PR itself.

  • scripts/deps/publish.mjs (new): commits the changed lockfiles to deps/weekly-refresh through the GitHub API, so the commit is signed by GitHub as before. It then opens or updates a "Weekly dependency refresh ready for review" issue containing the refresh report and a one-click link to open the PR. The link prefills the PR title and a Closes reference to the issue, so merging the PR closes the issue.
  • When the issue is already open from an earlier week, the script updates the report and comments to notify again. When a PR from the branch is already open, the issue points to it and ci-apps is dispatched so checks run on the new commit. When nothing changed, an open issue is closed.
  • deps-weekly-refresh.yml: replaces the peter-evans/create-pull-request step with the script. The issue is assigned to avner-m and mentions @avner-m @mattrglobal/labs-engs. Permissions are now contents: write, issues: write, pull-requests: read, actions: write.
  • scripts/deps/publish.test.mjs (new): tests for the PR link and issue body.

Why

The first scheduled run (2026-11-09) refreshed the lockfiles and pushed the branch, then failed at PR creation with "GitHub Actions is not permitted to create or approve pull requests". That setting is disabled at org level, and adding a token to a public repo isn't an option. Issues aren't covered by that setting, so the workflow stays automated up to the final click.

A side benefit: a PR opened by a person triggers ci-apps through pull_request as normal.

Testing

  • node --test scripts/deps/*.test.mjs: 7 pass (3 new, 4 existing).
  • The API calls haven't run yet. After merge, run "Weekly dependency refresh" with workflow_dispatch and check that the branch commit shows as Verified, the issue is assigned and mentions the team, and the link opens a prefilled PR.

🤖 Generated with Claude Code

The org doesn't let GITHUB_TOKEN open PRs, so the first scheduled run
pushed its branch and then failed. The workflow now commits the
lockfiles through the API (GitHub-signed) and opens or updates an
issue, assigned and mentioning the reviewers, with a one-click link to
open the PR. Merging that PR closes the issue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avner-m
avner-m force-pushed the ci/deps-refresh-ci-token branch from a70d43a to 48a0170 Compare November 8, 2026 23:04
@avner-m avner-m changed the title build(ci): open the weekly refresh PR with the CI user token build(ci): hand the weekly refresh PR off through a tracking issue Nov 8, 2026
@avner-m
avner-m marked this pull request as ready for review November 8, 2026 23:10
@avner-m
avner-m requested a review from a team as a code owner November 8, 2026 23:10
@avner-m
avner-m merged commit 2b21aa0 into master Nov 9, 2026
4 checks passed
@avner-m
avner-m deleted the ci/deps-refresh-ci-token branch November 9, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants