Skip to content

Commit

Permalink
build-and-push-assets: more defensive git checkout/pull (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrommen authored Aug 6, 2024
1 parent 4c15655 commit e23811f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-push-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,18 @@ jobs:
- name: Checkout and merge the built branch
if: ${{ github.ref_type == 'branch' }}
run: |
git checkout ${{ env.BUILT_BRANCH_NAME }} || git checkout -b ${{ env.BUILT_BRANCH_NAME }}
git show-ref -q refs/remotes/origin/${{ env.BUILT_BRANCH_NAME }} && git checkout ${{ env.BUILT_BRANCH_NAME }} || git checkout -b ${{ env.BUILT_BRANCH_NAME }}
git merge ${{ github.ref_name }}
- name: Git pull on re-run
if: ${{ (github.run_attempt > 1) && (github.ref_type != 'tag') }}
run: git pull
run: git show-ref -q refs/remotes/origin/$(git branch --show-current) && git pull || true

- name: Checkout and merge the release branch
if: ${{ github.ref_type == 'tag' && env.RELEASE_BRANCH_ENABLED == 'yes' }}
run: |
git checkout ${{ github.event.repository.default_branch }}
git checkout ${{ inputs.RELEASE_BRANCH_NAME }} || git checkout -b ${{ inputs.RELEASE_BRANCH_NAME }}
git show-ref -q refs/remotes/origin/${{ inputs.RELEASE_BRANCH_NAME }} && git checkout ${{ inputs.RELEASE_BRANCH_NAME }} || git checkout -b ${{ inputs.RELEASE_BRANCH_NAME }}
git merge ${{ github.event.repository.default_branch }}
- name: Checkout temporary tag branch
Expand Down

0 comments on commit e23811f

Please sign in to comment.