Repository navigation
GH Actions: add yaml/GHA workflow QA checks - #57
Merged
Merged
Conversation
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.
Includes ignoring the new config file for dist packages via `.gitattributes`.
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
... to loosely safeguard valid and consistent yaml files. Includes adding a configuration file which loosens up the `default` ruleset to a degree I'm comfortable with. Ref: https://yamllint.readthedocs.io/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GH Actions: add new "pinact" job
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
pinacttooling via a reusable workflow as available since thePHPCSStandards/.github1.3.0 release.Pinact is a tool which can be used to:
cooldown) period is respected. The defaultmin-agesetting is 7 days.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:
.pinact.yamlfile. 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.cooldownsetting.At a later point in time we may want to increase this number. This should be done in conjunction with the
cooldownsetting in thedependabot.ymlconfiguration.Includes ignoring the new config file for dist packages via
.gitattributes.Refs:
GH Actions: add Yamllint to validate workflow
... to loosely safeguard valid and consistent yaml files.
Includes adding a configuration file which loosens up the
defaultruleset to a degree I'm comfortable with.Ref: https://yamllint.readthedocs.io/