Repository navigation
chore(deps): add Dependabot, and exempt bot commits from DCO in the bot's own pull requests - #25
Merged
Merged
Conversation
…ot's own pull requests .github/dependabot.yml: npm and GitHub Actions at the root, weekly. npm minor and patch releases come as one grouped pull request, each major on its own; Actions are grouped. fixtures/** is excluded from version and security updates alike: it is test data, outdated and vulnerable on purpose. Commit messages start with chore(deps), development dependencies included. DCO: Dependabot signs its commits off as [email protected], not as their author, so #19 failed the check. A commit is now exempt when the pull request was opened by dependabot[bot] or github-actions[bot] (the opener GitHub records, passed as --pr-author) and the commit is authored by that bot's noreply address. The author address alone would be spoofable; a person's commit pushed to a bot's pull request still needs a sign-off. Dry run against #19: before, 'signed off by [email protected] but authored by 49699333+dependabot[bot]...'; with --pr-author=dependabot[bot], exempt and passing. CONTRIBUTING.md says why fixtures are pinned, how to dismiss their alerts, and that the DCO exemption covers only a bot's own commits. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
…s, with a notice Dependabot-triggered runs get no repository secrets, so every Dependabot pull request failed 'No private material' with exit 2. When the pull request was opened by dependabot[bot] (github.event.pull_request.user.login, the same gate as the DCO exemption) and UPTIDE_PRIVATE_DENYLIST is empty, the step prints a ::notice:: and checks document names only. Pushes to main and every other pull request from this repository still require the denylist (exit 2 without it); forks keep the document-name check. The secret is not added to the Dependabot secrets: dependency code runs in that job before the check and can reach later steps, and a bump is exactly the code nobody has reviewed. CONTRIBUTING.md says so. public-tree.test.ts runs the step's own shell block from ci.yml for each case: push with and without the secret, Dependabot's pull request with and without it, other authors, and a fork. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
7 tasks done
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.
Summary
This adds Dependabot for npm and GitHub Actions, keeps it away from
fixtures/, and lets the DCO check pass on Dependabot's own pull requests without opening a hole in it..github/dependabot.yml//npm-minor-and-patch); each major on its ownfixtures/**, for version and security updateschore(deps), development dependencies includedchore(deps)fixtures/is test data that is outdated and vulnerable on purpose; updating it would change what the tests assert. The file was checked against SchemaStore'sdependabot-2.0schema (keys and enums). GitHub validates it again after merge, and the repository's Dependabot tab shows any errors.DCO and bots
Why #19 fails today. Dependabot does sign off, but as
[email protected], while it authors commits as49699333+dependabot[bot]@users.noreply.github.com. The check rejects a sign-off in someone else's name.The exemption. It applies to
dependabot[bot]andgithub-actions[bot], and requires both:github.event.pull_request.user.login, which GitHub sets and a contributor can't. The workflow passes it as--pr-author.An author address on its own is just text in a commit: anyone can write one, so checking only that would let any pull request skip the sign-off. A person's commit pushed to a Dependabot pull request still needs the line.
Dry run against #19's head, with the exact refs and arguments the workflow uses:
GitHub's API reports #19's opener as
dependabot[bot], the value the workflow will receive.Tests (
packages/cli/src/dco.test.ts):exempt(Dependabot and Actions).CONTRIBUTING.md
Private-material check on Dependabot pull requests
Why it failed. Dependabot-triggered runs get no repository secrets, so
No private materialexited 2 on every Dependabot PR (#19'stestjobs).The step now behaves as follows:
mainmainrun: "744 tracked files, 13 private identifiers … clean")maindependabot[bot]::notice::, document names only, exit 0dependabot[bot]The gate is
github.event.pull_request.user.login, the same as the DCO exemption.public-tree.test.tsruns the step's own shell block fromci.ymlfor each row.Why the secret stays out of Dependabot secrets. Dependency code runs in that job before the check (the linter from
node_modules) and can reach later steps through$GITHUB_ENV. A bump is exactly the code nobody has reviewed yet, so it could read the list. CONTRIBUTING.md says so. Whatever a Dependabot PR brings is still scanned with the secret when it merges tomain.Not in this PR (repository settings)
@dependabot rebase. A re-run alone reuses the old merge commit, and with it the old workflow.Tests: core 828 passed, cli 322 passed;
biomeclean.🤖 Generated with Claude Code