8000 Add reusable Action Pinning Check (pinact) + canonical config by dkastl · Pull Request #48 · geolonia/.github · GitHub
[go: up one dir, main page]

Skip to content

Add reusable Action Pinning Check (pinact) + canonical config - #48

Merged
dkastl merged 2 commits into
mainfrom
feat/actions-pinning-standard
Jun 8, 2026
Merged

dkastl merged 2 commits into
mainfrom
feat/actions-pinning-standard

Conversation

@dkastl
@dkastl dkastl commented Jun 8, 2026 •
Copy link
Copy Markdown
Contributor

Builds the enforcement primitive and shared config for the org GitHub Actions pinning standard (geolonia-operations#143 + #148).

What this adds

  • .github/workflows/reusable-pinact-check.yml — per-PR reusable gate that runs pinact in validation-only mode (fix: false + --verify-comment + --verify-min-age). It never edits files or pushes; it only fails the check when an action is unpinned, has a mismatched version comment, or is younger than the configured minimum release age. Its own actions are SHA-pinned (actions/checkout v6.0.2, suzuki-shunsuke/pinact-action v3.0.0).
  • workflow-templates/pinact-check.yml + .properties.json — org Actions-picker template so any repo opts in with a few lines.
  • pinact/.pinact.yml — canonical min_age: { value: 7, always: true } config repos copy (the Actions analog of pnpm minimumReleaseAge).
  • pinact/.pre-commit-config.example.yaml — local auto-pin hook so devs pin before pushing.
  • docs/workflows.md — usage, prerequisites (.pinact.yml + Dependabot github-actions w/ cooldown 7 + groups), local pre-commit, adoption steps.

Notes

  • pinact-action v3.0.0 bundles pinact CLI v4.0.0, so CI and local runs use the same engine.
  • This PR only builds the primitive + shared config. Rolling the standard out across workspace repos (starting with a geolonia-infra-cdk pilot) and the @v1 tag move happen in follow-ups.
  • After merge, push the immutable version tag so the auto-release workflow floats v1 to include this reusable workflow.

Summary by CodeRabbit

  • New Features

    • Added an automated action pinning validation for pull requests that enforces SHA pinning, matching version comments, and a 7-day minimum release age.
  • Documentation

    • Added a setup guide, usage reference, and step-by-step instructions for enabling the pinning check in repos.
  • Chores

    • Added reusable workflow, workflow template, canonical pinning configuration, and an example pre-commit config to support the check.

Establishes the org GitHub Actions pinning standard primitive:

- reusable-pinact-check.yml: per-PR gate running pinact in
  validation-only mode (fix: false, verify-comment, verify-min-age).
  SHA-pins its own actions (checkout v6.0.2, pinact-action v3.0.0).
- workflow-template pinact-check.yml + .properties.json so repos opt in
  from the Actions picker.
- pinact/.pinact.yml: canonical min_age (7 days, always) config repos copy.
- pinact/.pre-commit-config.example.yaml: local auto-pin hook.
- docs/workflows.md: usage, prerequisites, local pre-commit, adoption.

pinact-action v3.0.0 bundles pinact CLI v4.0.0, so CI and local runs use
the same engine.
@coderabbitai
coderabbitai Bot commented Jun 8, 2026 •
Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fdfcbf86-d348-4595-b10b-48b3d2b9c7db

📥 Commits

Reviewing files that changed from the base of the PR and between a2b65de and d0eb4a9.

📒 Files selected for processing (3)
  • docs/workflows.md
  • pinact/.pre-commit-config.example.yaml
  • workflow-templates/pinact-check.yml

Walkthrough

This PR introduces a complete action-pinning validation system built on pinact. It adds a reusable GitHub Actions workflow that checks pinned actions and workflows, workflow templates for easy adoption, a canonical pinact configuration with a 7-day minimum release age, an example pre-commit hook, and documentation guiding users through setup and integration.

Changes

Pinact Action-Pinning CI Workflow

Layer / File(s) Summary
Reusable Pinact Validation Workflow
.github/workflows/reusable-pinact-check.yml
Defines the core reusable workflow that accepts an optional runs-on input, checks out the repository, and runs suzuki-shunsuke/pinact-action in validation-only mode with SHA verification, version-comment matching, and minimum-release-age enforcement enabled.
Workflow Templates for Adoption
workflow-templates/pinact-check.properties.json, workflow-templates/pinact-check.yml
Provides workflow template files enabling repos to quickly add the pinact check: a template properties JSON defining metadata, and 8000 a template workflow triggered on pull requests to the default branch that delegates to the reusable pinact workflow.
Pinact Configuration and Local Tooling
pinact/.pinact.yml, pinact/.pre-commit-config.example.yaml
Defines a canonical .pinact.yml configuration with a 7-day minimum release age policy enforced on every run, and provides an example .pre-commit-config.yaml integrating pinact run as a local pre-commit hook for workflow and action YAML file changes.
Adoption and Usage Documentation
docs/workflows.md
Provides documentation of the "Action Pinning Check" workflow, including purpose, PR trigger conditions, pinning requirements (SHA, version comments, minimum age), prerequisite files, available inputs, optional pre-commit setup, and step-by-step integration instructions.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly Related Issues

  • geolonia/geolonia-operations#144: The reusable pinact-check workflow, .pinact.yml, and templates implement the rollout elements referenced by this issue.
  • geolonia/geolonia-operations#143: Implements the requested reusable reusable-pinact-check.yml running suzuki-shunsuke/pinact-action with verify-comment and min-age checks.
  • geolonia/geolonia-operations#148: Adds the canonical .pinact.yml, pre-commit example, and SHA-pinned workflows described in the issue.
  • geolonia/geolonia-operations#142: Delivers the reusable workflow, config, pre-commit example, and templates aligning with the issue’s adoption plan.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly summarizes the main change: adding a reusable Action Pinning Check workflow and canonical configuration for pinact.
Description check ✅ Passed The description comprehensively documents all changes, provides clear context with issue references, and aligns with the PR objectives and file-level modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/actions-pinning-standard

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
github-actions Bot commented Jun 8, 2026
Copy link
Copy Markdown
Contributor

Secret Leak Check

OK No secrets detected in this PR's diff.

@coderabbitai coderabbitai Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/workflows.md`:
- Around line 178-192: The duplicate markdown headings "### Inputs" and "###
Adding it to a repo" trigger MD024; rename one of each pair to a unique
subsection title (for example change "### Inputs" to "### Workflow inputs" or
"### Check inputs" and change "### Adding it to a repo" to "### Adding it to
this repository" or "### Repository setup") so headings are distinct; update any
internal links or references that point to the old headings (search for the
exact strings "### Inputs" and "### Adding it to a repo") to match the new
titles to keep navigation and anchors working.

In `@pinact/.pre-commit-config.example.yaml`:
- Line 34: The current 'files' regex in .pre-commit-config.example.yaml only
matches repo-root action.yml (it contains the token action\.ya?ml); update that
'files' pattern so it also matches action.yml/action.yaml in subdirectories by
allowing an optional directory prefix (i.e., permit one or more path segments
before action\.ya?ml), so composite actions in nested folders are included in
the pre-commit check.

In `@workflow-templates/pinact-check.yml`:
- Around line 4-5: The workflow hard-codes the PR target branch via the
pull_request trigger's "branches: [main]" which prevents runs on repos with
different default branches; remove the "branches: [main]" line (i.e., leave only
"pull_request:" without a branches filter) or replace it with a configurable
input if you need restriction, so the pull_request trigger will run for PRs
targeting the repo's default branch; locate the "pull_request" block and the
"branches: [main]" entry in the template and delete or parameterize that line.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3b7043ae-30fa-4b33-be24-6484f4293fba

📥 Commits

Reviewing files that changed from the base of the PR and between 4b3b72a and a2b65de.

📒 Files selected for processing (6)
  • .github/workflows/reusable-pinact-check.yml
  • docs/workflows.md
  • pinact/.pinact.yml
  • pinact/.pre-commit-config.example.yaml
  • workflow-templates/pinact-check.properties.json
  • workflow-templates/pinact-check.yml

Comment thread docs/workflows.md Resolved
Comment thread pinact/.pre-commit-config.example.yaml Resolved
Comment thread workflow-templates/pinact-check.yml Resolved
- pinact-check.yml template: use $default-branch instead of hardcoded main
  (matches the bumblebee-scan template convention).
- .pre-commit-config.example.yaml: broaden files regex to match
  action.yml/action.yaml at any depth (composite actions in subdirs).
- docs/workflows.md: rename new subsections (Required files / Check inputs
  / Enabling the check) to avoid MD024 duplicate-heading collisions.
@github-actions
github-actions Bot commented Jun 8, 2026
Copy link
Copy Markdown
Contributor

Secret Leak Check

OK No secrets detected in this PR's diff.

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

0