Skip to content

Commit

Permalink
ci: Fix condition if nightly tag doesn't exist
Browse files Browse the repository at this point in the history
Fixes an error that was ocurring with our nightly releases where the CD
job would fail if the nightly tag doesn't exist on the remote, which
shouldn't be an error.
  • Loading branch information
afnanenayet committed May 14, 2023
1 parent 9980b6e commit 5087da5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git fetch origin --all
gh release delete nightly --yes || true
git push origin :nightly
# Taken from: https://stackoverflow.com/questions/46366042/how-to-check-if-tag-exists-in-if-else
# We don't want to try deleting the remote tag if it doesn't exist
# because that will trigger a failure and abort the nightly release
# job.
if [[ git rev-parse nightly >/dev/null 2>&1 ]]; then
git push origin :nightly
fi
git tag -d nightly || true
git tag nightly
git push origin nightly
Expand Down

0 comments on commit 5087da5

Please # to comment.