Skip to content

fix(ci): Pin all checkouts to triggering workflow_run commit in deploy-frontend.yml #396

@github-actions

Description

@github-actions

Summary

On workflow_run-triggered jobs, github.sha points to the default branch HEAD — not the commit that passed the upstream workflow. This causes actions/checkout to check out a different revision than what was tested, allowing a build-one-commit/deploy-another-manifests scenario.

Affected file

.github/workflows/deploy-frontend.yml — lines 64-67, 105-106, 121-123, 185-187

Required fix

Use github.event.workflow_run.head_sha as the ref input on every actions/checkout step and for the org.opencontainers.image.revision OCI label:

- uses: actions/checkout@v6
  with:
    fetch-depth: 0
    ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions