Skip to content

feat(renovate): match SHA-pinned actions in .rst documentation - #105

Merged
sbaerlocher merged 3 commits into
mainfrom
feat/renovate-rst-manager
Aug 15, 2026
Merged

feat(renovate): match SHA-pinned actions in .rst documentation#105
sbaerlocher merged 3 commits into
mainfrom
feat/renovate-rst-manager

Conversation

@sbaerlocher

Copy link
Copy Markdown
Member

Summary

  • Adds a third customManager to renovate-base.json that updates SHA-pinned GitHub Actions inside .rst documentation examples. Documentation pins drifted silently: in arillso/guide 9 of 10 pinned actions are behind, and a hand-fix only holds until the next release.
  • A match requires a 40-hex digest, whitespace and a # vN comment together. That structural condition is what spares placeholder SHAs, date-tagged pins and the deliberate @v4/@main counter-examples, rather than a blacklist that has to be maintained.
  • Adds a fixture test plus a CI job. No renovate-config-validator runs here, so a loosened regex would otherwise first surface as Renovate rewriting a documented "wrong" example into its opposite. The test reads the regex out of the preset with jq and selects the manager by its file pattern, so neither a copy nor an array index can drift.

renovate-actions, -ansible and -go extend renovate-base and inherit the manager. renovate-alpine.json has no extends and does not; repositories without SHA-pinned .rst files are unaffected because the pattern never matches.

Test plan

  • scripts/tests/test-renovate-rst-manager.sh passes, and fails with no customManager ... declares the /\.rst$/ file pattern when the manager is removed
  • Cross-checked against the real rst/guide/development/cicd.rst: 24 matches on the expected lines, 0 placeholders, 0 mutable refs, 0 date-tags
  • shellcheck and actionlint clean; the existing test-workflow-input-injection.sh guard still passes
  • CI green

Documentation examples pin actions by SHA like workflows do, but no manager
covered them, so every pin in a .rst file drifted until someone bumped it by
hand. A match needs digest, whitespace and a `# vN` comment together, which
leaves placeholder SHAs and deliberate counter-examples untouched.

Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
No renovate-config-validator runs on this repo, so a loosened regex would
first surface as Renovate rewriting a documented "wrong" example into its
opposite. The regex is read out of the preset with jq rather than restated,
so the guard cannot drift away from the artifact it protects.

Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
Without a job the guard is dead weight, and the workflow-input-injection
guard next to it is the precedent. Only jq and grep -P are needed, both
present on the runner.

Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
@sbaerlocher
sbaerlocher merged commit 41fa53b into main Aug 15, 2026
10 checks passed
@sbaerlocher
sbaerlocher deleted the feat/renovate-rst-manager branch August 15, 2026 21:19
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