Skip to content

Commit

Permalink
add failsafes
Browse files Browse the repository at this point in the history
  • Loading branch information
mushroomempires committed Jan 14, 2025
1 parent 3f052e9 commit d537345
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/get-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,14 @@ jobs:
- name: "Get release: 1 for testing / stable, <date>.<commit_sha> for others"
id: get_release
run: |
RELEASE=$(echo ${{ github.ref_name }} | cut -d "-" -f2)-1
if [[ $(#RELEASE) != 10 || ${RELEASE::2} != 20 || ! ${RELEASE:4: -4} =~ ^0[1-9]$|1[0-2]$ ]]; then
echo "invalid release name"
exit 1
if [[ ${{ steps.get_stability.outputs.stability }} == "testing" || ${{ steps.get_stability.outputs.stability }} == "stable" ]]; then
RELEASE=$(echo ${{ github.ref_name }} | cut -d "-" -f2)-1
if [[ $(#RELEASE) != 10 || ${RELEASE::2} != 20 || ! ${RELEASE:4: -4} =~ ^0[1-9]$|1[0-2]$ ]]; then
echo "invalid release name"
exit 1
fi
else
RELEASE=$(date '+%H%M%S')
fi
echo "release=$RELEASE" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit d537345

Please sign in to comment.