Skip to content

Pin GitHub Actions to commit SHAs #52

@jesserockz

Description

@jesserockz

GitHub Actions in this repository reference actions or reusable workflows by mutable tag or branch instead of an immutable commit SHA.

Pinning to a full 40-character commit SHA prevents supply-chain attacks where a compromised or force-pushed tag silently changes the code your workflows execute.

Unpinned references

  • actions/checkout@v4.2.2
  • docker/build-push-action@v6.15.0
  • docker/login-action@v3.4.0
  • docker/setup-buildx-action@v3.10.0
  • docker/setup-qemu-action@v3.6.0

What to do

Replace each tag/branch reference with its commit SHA and add a version comment:

# Before
uses: actions/checkout@v4

# After
uses: actions/checkout@11bd719...  # v4.2.2

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions