Skip to content

Pin actions to latest commit#499

Merged
priteau merged 9 commits intomainfrom
pin-actions
Apr 2, 2026
Merged

Pin actions to latest commit#499
priteau merged 9 commits intomainfrom
pin-actions

Conversation

@Alex-Welsh
Copy link
Copy Markdown
Member

Updates all actions that were previously pinned to a tag, to be pinned to the latest commit hash

This is to mitigate the risk of supply chain attacks that target upstream GitHub actions, and avoid node 20 deprecation warnings at the same time.

After doing this all by hand for SKC, I decided to just ask Gemini for a script to do it this time. I iterated on it a few times but the script is here

It ignores anything in the StackHPC org

@Alex-Welsh Alex-Welsh requested a review from a team as a code owner March 31, 2026 11:00
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the GitHub Actions in the setup and slack-alert workflows to use specific commit SHAs instead of version tags for enhanced security. The review feedback recommends appending the human-readable version tags as comments to the pinned SHAs to improve maintainability and clarity for future updates.

@stackhpc-ci
Copy link
Copy Markdown
Contributor

stackhpc-ci commented Mar 31, 2026

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖success

Validation Output


Warning: Deprecated attribute

  on repositories.tf line 20, in resource "github_repository" "repositories":
  20:       has_downloads,

The attribute "has_downloads" is deprecated. Refer to the provider
documentation for details.
Success! The configuration is valid, but there were some validation warnings
as shown above.


Terraform Plan 📖success

Show Plan

undefined

Pusher: @Alex-Welsh, Action: pull_request, Working Directory: ``, Workflow: Terraform GitHub

@priteau
Copy link
Copy Markdown
Member

priteau commented Mar 31, 2026

Can the script add the tag as a version, as suggested by Gemini code review?

Also, can you confirm it is using the SHA of the latest published tag, when once is available?

Pins actions/checkout to v6.0.2 commit hash instead of the tag.
Pins actions/github-script to v8 commit hash instead of the tag.
Pins actions/setup-python to v6.2.0 commit hash instead of the tag.
Pins actions/upload-artifact to v7.0.0 commit hash instead of the tag.
…54539b

Pins dcarbone/install-yq-action to v1.3.1 commit hash instead of the tag.
…b6c85

Pins hashicorp/setup-terraform to v4.0.0 commit hash instead of the tag.
…87c70dc60

Updates nick-fields/retry from v3 to v4.0.0 and pins to a specific commit hash instead of the tag.
…162a307590698245be95

Updates slackapi/slack-github-action from v1.26.0 to v3.0.1 and pins to a specific commit hash instead of the tag.
@Alex-Welsh
Copy link
Copy Markdown
Member Author

Can the script add the tag as a version, as suggested by Gemini code review?

Also, can you confirm it is using the SHA of the latest published tag, when once is available?

Added comments showing which version is being used. The script should pull the commit for the latest published tag, and fall back to the main branch if if it fails

@Alex-Welsh Alex-Welsh requested a review from priteau April 2, 2026 08:07
@priteau priteau merged commit 39be3ef into main Apr 2, 2026
4 checks passed
@priteau priteau deleted the pin-actions branch April 2, 2026 12:27
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.

4 participants