Repository navigation
Conversation
Every Dependabot bump of a shipped dependency changed the committed notices, so the app's devkit-notices --check failed until someone ran devkit-notices and committed the result (Persistent #13 and #19). .github/workflows/dependabot-notices.yml is a reusable workflow apps call on pull_request. For Dependabot's own pull requests from a branch in the repo it regenerates the notices in a read-only job that installs with --ignore-scripts, so no dependency code runs, then a second job that installs and runs nothing commits only the listed outputs with [dependabot skip] and pushes with GITHUB_TOKEN. Because that push starts no pull_request runs without a maintainer's approval, it dispatches the workflows the caller names on the branch instead. No secret, GitHub App or deploy key is needed. devkit-notices gains --list lockfiles and --list outputs, so the workflow finds every lockfile to install and every notices file from devkit.config.mjs, with no repo layout baked into devkit.
A workflow dispatched with GITHUB_TOKEN is not a Dependabot run, so it gets the repo's Actions secrets and its own permissions while it installs the bumped packages with their scripts. The workflow now refuses to dispatch one that names a secret or grants write access, and the README says to list only read-only workflows. Steps run with shell: bash (pipefail), and the --list output is captured before it is read, so a devkit older than v0.33.0 fails the step instead of producing an empty list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Apps that commit their third-party notices and check them with
devkit-notices --checkfail CI on every Dependabot bump of a shipped dependency, until someone runsdevkit-noticesand commits the result (Persistent #13 and #19).What
.github/workflows/dependabot-notices.yml, a reusable workflow apps call onpull_request. For Dependabot's own pull requests from a branch in the repo it:persist-credentials: false):npm ci --ignore-scriptsat the root and in every standalone lockfile the notices read, runsdevkit-notices, and uploads only the notices outputs that changed. Any other changed file fails the job.contents: write,actions: write): installs nothing and runs no repo code. It copies only the listed outputs (refusing.., absolute paths,.git/and.github/), commits with[dependabot skip]so Dependabot keeps rebasing, and pushes to the head ref with the head SHA as parent, so a moved branch fails rather than being overwritten.GITHUB_TOKENpush starts nopull_requestruns without a maintainer's approval, it dispatches the caller'srerun-workflowson the branch. It refuses one whose file names a secret or grants write access, since a dispatched run is not sandboxed like a Dependabot run.devkit-notices --list lockfiles|outputs, so the workflow derives what to install and what to commit fromdevkit.config.mjs, with no repo layout in devkit.release-notes/0.33.0.md.Trade-offs
pull_requestruns (including CodeQL) without the dispatch step, at the cost of a credential to create and rotate.pull_requestruns sit awaiting approval and can be ignored.Testing
npm run validatepasses. New tests cover--list, andtest/dependabot-notices-workflow.test.mjsholds the security posture (read-only generate job,--ignore-scriptson every install, nothing run in the push job,[dependabot skip], the dispatch guard).npm ci --ignore-scriptsin both lockfiles,devkit-notices --checkpasses, and--listprints.plusapps/electron-desktop, and both outputs.AI disclosure: this comment and the related code were written with the assistance of AI.