Skip to content
Merged
Changes from all commits
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
47 changes: 47 additions & 0 deletions .github/workflows/update-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Update Dependencies

on:
schedule:
- cron: '0 4 * * 1' # Mondays, 04:00 UTC
workflow_dispatch: {}

permissions:
contents: write
pull-requests: write

concurrency:
group: update-dependencies
cancel-in-progress: false

jobs:
update-dependencies:
# The branch push and the pull request both target this repository, so
# this must never run on a fork.
Comment on lines +18 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Comments narrate workflow configuration

These comments restate the adjacent repository guard, installation setting, build hook, and Changesets input. This duplicates the configuration in prose that must be maintained alongside it and can drift when the workflow changes; remove the narration and use focused tests where the behavior needs coverage.

Context Used: Comments and docs in code are suspicious. Is test ... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

if: github.repository == 'pnpm/setup'
name: 'Update dependencies'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

# This repository's own action, on the pnpm it ships. `install: false`
# because pnpm/update deletes the lockfile and node_modules before it
# resolves anything, so installing first would be thrown away.
- uses: ./
with:
version: '^12.0.0'
install: false

- uses: pnpm/update@v0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 security Mutable updater receives write access

The scheduled job invokes pnpm/update@v0 with repository-content and pull-request write permissions. Retargeting or compromising this mutable tag would let code outside the reviewed revision push unauthorized changes or alter pull requests, so pin the action to an immutable commit. How this was verified: The workflow grants write permissions at workflow scope and invokes the updater through the mutable v0 tag without another control restricting its token access.

with:
# `dist/index.js` is committed, and pr-check rebuilds it and fails on
# any difference. Every runtime dependency is inlined into that
# bundle, and esbuild itself decides how — so it has to be
# regenerated in the same commit as the bump, or the update pull
# request can never go green. This is the step Dependabot had no way
# to run.
post-update: pnpm run build
verify: |
pnpm exec tsc --noEmit
pnpm test
# No .changeset directory in this repository.
changesets: false
Loading