update auto_release workflow

This commit is contained in:
Gerrit Gogel 2023-08-26 11:45:24 +02:00
parent cda1b06cb0
commit 3805dda336

View file

@ -38,11 +38,12 @@ jobs:
- name: Get Previous Build Number and Compute Next - name: Get Previous Build Number and Compute Next
id: build_number id: build_number
run: | run: |
PREVIOUS_BUILD=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ LATEST_TAG=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases | \ https://api.github.com/repos/${{ github.repository }}/tags | \
jq -r --arg FOLDER "$FOLDER_CHANGED" '.[] | select(.name | startswith($FOLDER)) | .name' | head -1 | awk -F_ '{print $3}') jq -r --arg FOLDER "$FOLDER_CHANGED" '.[] | select(.name | startswith($FOLDER)) | .name' | head -1)
if [[ $PREVIOUS_BUILD ]]; then if [[ $LATEST_TAG ]]; then
PREVIOUS_BUILD=$(echo $LATEST_TAG | awk -F_ '{print $3}')
NEXT_BUILD=$(printf "%03d" $((10#$PREVIOUS_BUILD + 1))) NEXT_BUILD=$(printf "%03d" $((10#$PREVIOUS_BUILD + 1)))
else else
NEXT_BUILD="001" NEXT_BUILD="001"