Skip to content

chore(deps): add Dependabot, and exempt bot commits from DCO in the bot's own pull requests - #25

Merged
lucasbraum merged 2 commits into
mainfrom
chore/dependabot
Oct 6, 2026
Merged

lucasbraum merged 2 commits into
mainfrom
chore/dependabot

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

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 GitHub Actions
Directory / /
Schedule weekly weekly
Grouping one PR for minor + patch (npm-minor-and-patch); each major on its own all in one group
Excluded fixtures/**, for version and security updates —
Commit prefix chore(deps), development dependencies included chore(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's dependabot-2.0 schema (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 as 49699333+dependabot[bot]@users.noreply.github.com. The check rejects a sign-off in someone else's name.

The exemption. It applies to dependabot[bot] and github-actions[bot], and requires both:

  • the pull request was opened by that bot. That's github.event.pull_request.user.login, which GitHub sets and a contributor can't. The workflow passes it as --pr-author.
  • the commit is authored by that bot's noreply address.

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:

$ node scripts/dco.mjs refs/uptide/base refs/uptide/pr-head --base-name=origin/main
1 commits on refs/uptide/pr-head since origin/main
  ✗ 74704ad4 is signed off by [email protected] but authored by 49699333+dependabot[bot]@users.noreply.github.com: chore(deps): bump source-map-js from 1.2.1 to 1.2.2
exit 1

$ node scripts/dco.mjs refs/uptide/base refs/uptide/pr-head --base-name=origin/main --pr-author='dependabot[bot]'
1 commits on refs/uptide/pr-head since origin/main
  · 74704ad4 authored by dependabot[bot], exempt: chore(deps): bump source-map-js from 1.2.1 to 1.2.2
every commit is signed off
exit 0

GitHub's API reports #19's opener as dependabot[bot], the value the workflow will receive.

Tests (packages/cli/src/dco.test.ts):

  • A bot's own commits in the pull request it opened pass, and are listed as exempt (Dependabot and Actions).
  • The same Dependabot-authored commit fails when the pull request was opened by someone else, or by a different bot.
  • A person's unsigned commit in a Dependabot pull request fails.

CONTRIBUTING.md

  • A new section, "Fixtures are pinned on purpose": Dependabot alerts on fixtures are dismissed as "Vulnerable code is not actually used", and a fixture changes only together with its tests.
  • One line in the DCO section on the bot exemption and its limits.

Private-material check on Dependabot pull requests

Why it failed. Dependabot-triggered runs get no repository secrets, so No private material exited 2 on every Dependabot PR (#19's test jobs).

The step now behaves as follows:

Event Denylist Result
push to main set identifier scan (the latest main run: "744 tracked files, 13 private identifiers … clean")
push to main missing exit 2
pull request opened by dependabot[bot] missing ::notice::, document names only, exit 0
pull request opened by dependabot[bot] set identifier scan
any other pull request from this repository missing exit 2
fork missing document names only (unchanged)

The gate is github.event.pull_request.user.login, the same as the DCO exemption. public-tree.test.ts runs the step's own shell block from ci.yml for 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 to main.

Not in this PR (repository settings)

Tests: core 828 passed, cli 322 passed; biome clean.

🤖 Generated with Claude Code

lucasbraum and others added 2 commits October 5, 2026 21:23
…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]>
@lucasbraum
lucasbraum merged commit 4f2d354 into main Oct 6, 2026
5 checks passed
@lucasbraum
lucasbraum deleted the chore/dependabot branch October 6, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant