Skip to content

GH Actions: add new "pinact" job - #127

Merged
jrfnl merged 1 commit into
mainfrom
feature/ghactions-add-pinact-job
Oct 21, 2026
Merged

jrfnl merged 1 commit into
mainfrom
feature/ghactions-add-pinact-job

Conversation

@jrfnl

@jrfnl jrfnl commented Oct 21, 2026

Copy link
Copy Markdown
Member

Description

In a previous PR, all action runners used in GH Actions workflows where "pinned" to precise versions for security reasons. However, that doesn't prevent new jobs, or changes to existing jobs, from being introduced which do not correctly pin action runners.

This commit introduces a new GHA job which runs the pinact tooling via a reusable workflow as available since the PHPCSStandards/.github 1.3.0 release.

Pinact is a tool which can be used to:

  • Update the action runner references in existing workflows to commit-hash "pinned" versions.
  • Verify that the commit hash to which an action runner is pinned is valid.
  • Verify that a "pinned" commit-hash matches the version number in the comment following the action runner reference.
  • Verify that a mandatory "minimum age" (cooldown) period is respected. The default min-age setting is 7 days.
  • Safeguard that any changes in workflows do not introduce new unpinned action runner references.

The pinact action runner can also push a new commit to open PRs if the "verification"checks fail, however I do not think this is necessary at this time. The inline annotations in a PR and the failing build should be sufficient to prevent new issues from entering the workflows.

Notes:

  • I've added a .pinact.yaml file. This is required for the reusable workflow to run, but also ensures that running the tool locally vs running it in CI will yield the same results.
  • In the configuration, I've set the "min-age" for dependencies to 3 days (default = 7) to be in line with the GitHub default cooldown setting. At a later point in time we may want to increase this number. This should be done in conjunction with the cooldown setting in the dependabot.yml configuration.

Refs:

In a previous PR, all action runners used in GH Actions workflows where "pinned" to precise versions for security reasons.
However, that doesn't prevent new jobs, or changes to existing jobs, from being introduced which do not correctly pin action runners.

This commit introduces a new GHA job which runs the `pinact` tooling via a reusable workflow as available since the `PHPCSStandards/.github` 1.3.0 release.

Pinact is a tool which can be used to:
* Update the action runner references in existing workflows to commit-hash "pinned" versions.
* Verify that the commit hash to which an action runner is pinned is valid.
* Verify that a "pinned" commit-hash matches the version number in the comment following the action runner reference.
* Verify that a mandatory "minimum age" (`cooldown`) period is respected. The default `min-age` setting is 7 days.
* Safeguard that any changes in workflows do not introduce new unpinned action runner references.

The pinact action runner can also push a new commit to open PRs if the "verification"checks fail, however I do not think this is necessary at this time.
The inline annotations in a PR and the failing build should be sufficient to prevent new issues from entering the workflows.

Notes:
* I've added a `.pinact.yaml` file. This is required for the reusable workflow to run, but also ensures that running the tool locally vs running it in CI will yield the same results.
* In the configuration, I've set the "min-age" for dependencies to 3 days (default = 7) to be in line with the GitHub default `cooldown` setting.
    At a later point in time we may want to increase this number. This should be done in conjunction with the `cooldown` setting in the `dependabot.yml` configuration.

Refs:
* https://github.com/PHPCSStandards/.github/releases/tag/v1.3.0
* https://github.com/suzuki-shunsuke/pinact
* https://github.com/suzuki-shunsuke/pinact#configuration
* https://github.com/suzuki-shunsuke/pinact-action
@jrfnl
jrfnl merged commit 0d41980 into main Oct 21, 2026
17 checks passed
@jrfnl
jrfnl deleted the feature/ghactions-add-pinact-job branch October 21, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant