Skip to content

Commit

Permalink
Single step for branch lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Jul 9, 2024
1 parent 379b8d0 commit 152a880
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/holonix-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,10 @@ jobs:
name: holochain-ci

- name: Extract branch name
if: github.event_name == 'push'
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Use input branch name
if: github.event_name != 'push'
shell: bash
run: echo "${{ inputs.branch }}" >> $GITHUB_OUTPUT
run: |
changed_branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "branch=${${{ inputs.branch }}:-$changed_branch}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Print branch
Expand Down

0 comments on commit 152a880

Please sign in to comment.