Skip to content

Add the tool that pins actions, and a Dependabot file to keep them moving - #10

Merged
DenisDrobyshev merged 1 commit into
masterfrom
add/pin-actions-tool
Sep 18, 2026
Merged

DenisDrobyshev merged 1 commit into
masterfrom
add/pin-actions-tool

Conversation

@DenisDrobyshev

Copy link
Copy Markdown
Member

scripts/pin_actions.py rewrites every uses: owner/repo@tag as a commit, keeping the tag as a trailing comment — the form Dependabot maintains.

Why it matters here: a tag is a label somebody else can move, and these workflows run with a token that can write. pypa/gh-action-pypi-publish@release/v1 was a branch on the step that publishes to PyPI.

Also adds .github/dependabot.yml — this repository had none while it had no workflows, and it now has three. Pinned actions are only maintainable if something raises them.

Modes: --dry-run, --check (exit 1 if anything is unpinned, for CI), and the default rewrite. Only successful resolutions are cached, deliberately — see the docstring.

First applied to stadion in DrobyshevDev/stadion#8; the rest follow once that is green.

…ving

A tag is a label somebody else can move, and every workflow in this organisation
took one on trust. `pypa/gh-action-pypi-publish@release/v1` was a branch -- it
moves by design -- on the step that publishes to PyPI.

pin_actions.py resolves each reference through the API and rewrites it as a
commit with the tag kept as a trailing comment, which is the form Dependabot
understands: it raises the commit and the comment together. Only successes are
cached, because one timed-out request would otherwise decide that an action is
unresolvable for the rest of a run, and the same reference appears dozens of
times in a repository.

This repository had no Dependabot file while it had no workflows. It has three
now, and pinned actions are only maintainable if something raises them.
@DenisDrobyshev
DenisDrobyshev merged commit 7bc52a4 into master Sep 18, 2026
1 check passed
@DenisDrobyshev
DenisDrobyshev deleted the add/pin-actions-tool branch September 18, 2026 19:51
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