Skip to content

Commit 6670ec6

Browse files
committed
Set GITHUB_BRANCH_NAME early
1 parent 27b26cf commit 6670ec6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/actions/cmake/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ runs:
5858
TIME_TRACE: "${{ inputs.time_trace == 'true' && 'ON' || 'OFF' }}"
5959
PACKAGE: "${{ inputs.package == 'true' && 'ON' || 'OFF' }}"
6060
# GitHub creates merge commits for PRS, so we:
61-
# - explicitly provide branch name
6261
# - provide `github.head_ref` to get the actual commit SHA of the PR branch.
63-
GITHUB_BRANCH_NAME: "${{ github.head_ref || github.ref_name }}"
6462
GITHUB_HEAD_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
6563
run: |
6664
cmake \

.github/workflows/reusable-build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ jobs:
8585
runs-on: ${{ inputs.runs_on }}
8686
container: ${{ inputs.container != '' && fromJson(inputs.container) || null }}
8787

88+
env:
89+
# The way we checkout the code overrides github.head_ref, so we need to set the branch name manually
90+
GITHUB_BRANCH_NAME: "${{ github.head_ref || github.ref_name }}"
91+
8892
steps:
8993
- name: Cleanup workspace
9094
if: ${{ runner.os == 'macOS' }}

0 commit comments

Comments
 (0)