Skip to content

Commit

Permalink
ci: fix erroneous branch checking
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniBodor committed Sep 11, 2024
1 parent f8a7fbc commit 3472459
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/release_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ jobs:
fail-fast: true

steps:
- name: Display selection
run: |
echo "Branch selected: '${{ github.ref_name }}'"
echo "Release level selected: '${{ github.event.inputs.version_level }}'"
- name: Ensure that permitted release branch was selected
if: ${{ github.ref_name == 'main' }} || ${{ github.ref_name == 'dev' }}
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' }}
run: |
echo "Releasing from main or dev branch is not permitted, please select a valid release branch."
echo "Branch selected: '${{ github.ref_name }}'"
echo "Releasing from main or dev branch is not permitted, please select a different release branch."
exit 1
- name: Check GitHub Token Validity
Expand Down Expand Up @@ -129,9 +135,5 @@ jobs:
- name: Delete release branch other than main or dev
run: |
if [[ ${{ github.ref_name }} != "main" && ${{ github.ref_name }} != "dev" ]]; then
echo "-- deleting branch '${{ github.ref_name }}'"
git push origin -d ${{ github.ref_name }}
else
echo "-- branch '${{ github.ref_name }}' will not be deleted from remote"
fi
echo "-- deleting branch '${{ github.ref_name }}'"
git push origin -d ${{ github.ref_name }}

0 comments on commit 3472459

Please sign in to comment.