Skip to content

Bug: separate_env_public_create.yml uses pull_request context ref in workflow_dispatch #1838

Description

@coderabbitai

Summary

The checkout step in .github/workflows/separate_env_public_create.yml sets ref: ${{ github.event.pull_request.head.sha }}, which is undefined for workflow_dispatch events. This means the workflow will check out the wrong (or default) revision when triggered manually.

Details

File: .github/workflows/separate_env_public_create.yml
Lines: ~18–21

The checkout step currently uses:

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
  with:
    ref: ${{ github.event.pull_request.head.sha }}
    token: ${{ github.token }}

github.event.pull_request.head.sha is only populated for pull_request events. For workflow_dispatch, this expression evaluates to an empty string, causing checkout to fall back to the default branch rather than the intended commit.

Suggested Fix

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
  with:
    ref: ${{ github.sha }}
    token: ${{ github.token }}

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions