Skip to content

Pin GitHub Actions to immutable commit SHAs in workflow templates #171

@coderabbitai

Description

@coderabbitai

Summary

The workflow templates under playbooks/templates/.github/workflows/ (which generate .github/workflows/ansible-check.yml and related files in downstream roles such as linux-system-roles/ssh#239) currently reference GitHub Actions using floating tags rather than immutable commit SHAs.

Examples flagged

uses: actions/checkout@v6
uses: Jakuje/check-ansible-action@main

Risk

Floating tags (e.g., @v6, @main) can be moved upstream at any time, meaning CI behavior can change — or be hijacked — without any change to this repository. Pinning to full commit SHAs provides a stable, auditable reference.

Suggested fix

Replace floating tag references with the corresponding full 40-character commit SHAs, for example:

uses: actions/checkout@<full-sha-for-v6>
uses: Jakuje/check-ansible-action@<full-sha-for-current-main>

Tools such as Dependabot or zizmor can help automate this.

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