Skip to content

Conversation

@maennchen
Copy link
Member

Change

This PR pins all GH Actions to a specific commit sha.

All actions invocations are written as uses: [REPO]/[NAME]@[SHA] # [VERSION]. This is supported by dependabot and it will automatically create PRs with both the SHA and version change in the comment.

Reason

As seen with tj-actions/changed-files last week, any version (even if using a tag) can compromise a repository. The only way to prevent this, is to pin the version to a specific SHA.

This is also recommended by ScoreCard: https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies

Recommendation

This will potentially create a lot of dependabot update PRs with the current configuration. In the projects I maintain and pinned the dependencies, I added a grouping rule to reduce the noise:

version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
    groups:
      github-actions:
        applies-to: version-updates
        patterns:
          - "*"

@josevalim josevalim closed this Mar 17, 2025
@josevalim josevalim reopened this Mar 17, 2025
@maennchen maennchen force-pushed the jm/pin_github_actions branch from 66e5d26 to e039e0d Compare March 17, 2025 12:14
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@josevalim josevalim merged commit 6cd8082 into elixir-lang:main Mar 17, 2025
8 of 10 checks passed
@maennchen maennchen deleted the jm/pin_github_actions branch March 17, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants