This commit is contained in:
David Daly
2024-02-02 13:04:37 -05:00
committed by Edwin Sirko
parent cb79bd1a60
commit 8a5726de70
+5 -5
View File
@@ -25,8 +25,8 @@ jobs:
- name: Wait for successful publish - name: Wait for successful publish
id: wait-for-successful-publish id: wait-for-successful-publish
run: | run: |
START_TIME=$SECONDS START_TIME="$SECONDS"
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ") TIMESTAMP="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
while (( SECONDS - START_TIME < 60 )); do while (( SECONDS - START_TIME < 60 )); do
echo "Polling for workflow created after $TIMESTAMP" echo "Polling for workflow created after $TIMESTAMP"
RESULT=$(curl -s -L -H "Accept: application/vnd.github+json" \ RESULT=$(curl -s -L -H "Accept: application/vnd.github+json" \
@@ -36,9 +36,9 @@ jobs:
| jq '.workflow_runs[] | select(.name=="Publish Actions Package" and (.display_title | contains("${{ github.sha }}"))) | .status, .conclusion') | jq '.workflow_runs[] | select(.name=="Publish Actions Package" and (.display_title | contains("${{ github.sha }}"))) | .status, .conclusion')
# split the RESULT into an array # split the RESULT into an array
RESULT=($RESULT) mapfile -t RESULT <<< "$RESULT"
STATUS=$(echo ${RESULT[0]} | sed -e 's/^"//' -e 's/"$//') STATUS=$(echo "${RESULT[0]}" | sed -e 's/^"//' -e 's/"$//')
CONCLUSION=$(echo ${RESULT[1]} | sed -e 's/^"//' -e 's/"$//') CONCLUSION=$(echo "${RESULT[1]}" | sed -e 's/^"//' -e 's/"$//')
if [ -z "$STATUS" ]; then if [ -z "$STATUS" ]; then
echo "No workflow found yet" echo "No workflow found yet"
else else