Skip to content

Commit

Permalink
chore: Add locking mechanism with using jq syntax for selection
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Apr 27, 2023
1 parent 0367626 commit ae156c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
while [ $LOCKED = true ]; do
# if there are several release jobs at the same time
# allow to continue the one which id is less than others
FIRST_IN_PROGRESS=$(gh api /repos/scalameta/metals/actions/workflows/release.yml/runs?status=in_progress -q ".workflow_runs[].id" | sort | head -n 1)
FIRST_IN_PROGRESS=$(gh api /repos/scalameta/metals/actions/workflows/release.yml/runs -q ".workflow_runs[]|select(.status==\"in_progress\")|.id" | sort | head -n 1)
if [ "$FIRST_IN_PROGRESS" == "$GITHUB_RUN_ID" ]; then
LOCKED=false
else
Expand Down

0 comments on commit ae156c5

Please sign in to comment.