Skip to content

Adopt gh actions-lock for GitHub Actions #199

Closed

Description

GitHub Actions in this repository reference actions or reusable workflows by mutable tag or branch, and are not yet locked with gh actions-lock.

gh actions-lock keeps readable version tags in your uses: lines and records the exact commit SHA of every direct and transitive action in .github/workflows/actions.lock. A compromised or force-pushed tag can no longer silently change the code your workflows execute, and changes to the lockfile are visible in pull request diffs.

What is missing

  • No lockfile found at .github/workflows/actions.lock
  • No verify workflow found at .github/workflows/verify-lockfile.yml

What to do

  1. Install the extension and generate the lockfile:

    gh extension install github/gh-actions-lock
    gh actions-lock

    Keep version tags in uses: (for example actions/[email protected]). Any inline commit SHAs are rewritten back to version tags automatically.

  2. Add .github/workflows/verify-lockfile.yml, which runs gh actions-lock --verify on every pull request and push to catch drift or tampering.

  3. Commit .github/workflows/actions.lock and the verify workflow.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions