@@ -167,22 +167,34 @@ jobs:
167167 tag_name : ${{ env.RELEASE }}
168168 files : projectGenerator-linux-armv7l-gui.gz
169169
170- - name : Get Latest Nightly Release ID
170+ - name : Extract Tag Name
171+ run : |
172+ TAG_NAME=${GITHUB_REF#refs/tags/}
173+ echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
174+ echo "Detected Tag: ${TAG_NAME}"
175+
176+ - name : Get Release ID for the Tag
171177 id : get_release
172178 run : |
173179 RELEASE_ID=$(curl -s \
174180 -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
175181 -H "Accept: application/vnd.github.v3+json" \
176- https://api.github.com/repos/openframeworks/projectGenerator/releases | jq '.[] | select(.tag_name=="nightly") | .id')
182+ https://api.github.com/repos/openframeworks/projectGenerator/releases | jq -r '.[] | select(.tag_name=="${{ env.TAG_NAME }}") | .id')
183+
184+ if [ -z "$RELEASE_ID" ]; then
185+ echo "Release ID not found for tag: ${{ env.TAG_NAME }}"
186+ exit 1
187+ fi
188+
177189 echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_ENV
178190 echo "Found Release ID: ${RELEASE_ID}"
179191
180- - name : Update Nightly Release Description
192+ - name : Update Release Description
181193 run : |
182194 curl -X PATCH \
183195 -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
184196 -H "Accept: application/vnd.github.v3+json" \
185197 https://api.github.com/repos/openframeworks/projectGenerator/releases/${{ env.RELEASE_ID }} \
186198 -d '{
187- "body": "Updated nightly release: '"$(date '+%Y-%m-%d %H:%M:%S')"'"
199+ "body": "Updated release for tag: ${{ env.TAG_NAME }} - '"$(date '+%Y-%m-%d %H:%M:%S')"'"
188200 }'
0 commit comments