Skip to content

SHA-pinning policy rejects locked actions when invoked through a reusable workflow #169

Done

Description

@lefort1

Description

When the Require actions to be pinned to a full-length commit SHA policy is enabled, GitHub Actions rejects version-tagged actions executed through a reusable workflow, even when the actions are covered by a valid workflow lockfile.

The same reusable workflow runs successfully when triggered directly via workflow_dispatch.

Disabling the SHA-pinning policy allows both workflows to execute successfully.

Steps to reproduce

Created a minimal repository containing two workflows and a generated lockfile.

1. Foo — Reusable workflow (.github/workflows/foo.yml)

name: Foo - Reusable Checkout and List

on:
  workflow_call:
  workflow_dispatch:

jobs:
  checkout-and-list:
    runs-on: github-linux-x64-runner
    steps:
      - name: Checkout repository
        uses: actions/[email protected]

      - name: List files
        run: ls -la

2. Bar — Caller workflow (.github/workflows/bar.yml)

name: Bar - Calls Workflow Foo

on:
  workflow_dispatch:

jobs:
  call-foo:
    uses: ./.github/workflows/foo.yml

3. Generate the workflow lockfile

Run gh actions-lock and commit the generated .github/workflows/actions.lock:

version: 'v0.0.3'
workflows:
    '.github/workflows/bar.yml': []
    '.github/workflows/foo.yml':
        - 'actions/[email protected]'
dependencies:
    'actions/[email protected]':
        ref: 'v4.4.0'
        commit: 'sha1-11d5960a326750d5838078e36cf38b85af677262'
        owner_id: 44036562
        repo_id: 197814629

4. Enable SHA-pinning enforcement

Enable the Require actions to be pinned to a full-length commit SHA policy at the organization level.

5. Execute both workflows

Trigger Foo and Bar independently using workflow_dispatch.

Actual behavior

  • Foo: Executes successfully.
  • Bar: Fails because actions/[email protected] is not SHA-pinned, despite being covered by the lockfile.
  • Bar with SHA-pinning enforcement disabled: Executes successfully.

Error:

The action actions/[email protected] is not allowed in My-Org/github-sha-policy-testing because all actions must be from a repository owned by your enterprise, created by GitHub, or match one of the patterns: advanced-security/component-detection-dependency-submission-action@*, astral-sh/setup-uv@*, [...] . All actions must also be pinned to a full-length commit SHA.

Expected behavior

Both workflows should execute successfully with SHA-pinning enforcement enabled.

According to GitHub's [documentation on workflow dependency lockfiles](https://docs.github.com/en/actions/concepts/security/workflow-dependency-lockfiles), dependencies covered by a valid lockfile should satisfy the SHA-pinning requirement without requiring full-length commit SHAs in the workflow YAML.

This should apply whether the workflow is executed directly or invoked as a reusable workflow.

Additional context

The behavior suggests that the SHA-pinning policy does not consistently recognize lockfile coverage when actions are executed through a reusable workflow.

Activity

  1. nodeselector commented on Oct 14, 2026

    @nodeselector
    Collaborator

    @lefort1 thanks for opening this. I'm working on a fix right now, it'll be on the backend, and won't require any updates to the CLI.

  2. jessehouwing commented on Oct 14, 2026

    @jessehouwing
    Contributor

    @nodeselector will that policy get a better description?

  3. nodeselector commented on Oct 14, 2026

    @nodeselector
    Collaborator

    @jessehouwing I'd be up to talk about the error messages when there are valid policy issues but this one is incoherent because of a bug in how the policy is validated in the backend. For this issue we shouldn't show a better error message, we shouldn't error.

  4. jessehouwing commented on Oct 14, 2026

    @jessehouwing
    Contributor

    3. @jessehouwing I'd be up to talk about the error messages when there are valid policy issues but this one is incoherent because of a bug in how the policy is validated in the backend. For this issue we shouldn't show a better error message, we shouldn't error.

    I meant more that the policy description "require actions to be pinned to sha". Ideally it mentions that the actions or workflows must be locked/pinned...

    And how does the policy compare to the new preview actions policy "require lock files"

  5. nodeselector commented on Oct 15, 2026

    @nodeselector
    Collaborator

    @lefort1 this should be addressed now please let me know if you're still seeing this behavior.

  6. nodeselector commented on Oct 15, 2026

    @nodeselector
    Collaborator

    I meant more that the policy description "require actions to be pinned to sha". Ideally it mentions that the actions or workflows must be locked/pinned...

    💯 we're going to update the text for that setting.

    And how does the policy compare to the new preview actions policy "require lock files"

    You had another issue that actually demonstrates the need for that require lock files policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions