ci(blocked_prs): fix merge workflow

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2025-03-12 20:40:33 -07:00
parent c2b7b4c82a
commit c75ae4170f
No known key found for this signature in database
GPG Key ID: E10E321EB160949B

View File

@ -23,11 +23,9 @@ jobs:
id: gather_deps
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
owner="${{ github.repository_owner }}"
owner_repo="${{ github.repository }}"
repo="${owner_repo#"${owner}/"}"
owner=$(echo "${{ github.repository }}" | cut -d '/' -f 1)
repo=$(echo "${{ github.repository }}" | cut -d '/' -f 2)
blocked_prs=$(
gh api graphql \
-f repo="$repo" \
@ -52,16 +50,16 @@ jobs:
--paginate \
--slurp \
| jq -c --argjson pr "${{ github.event.pull_request.number }}" '
[.[].data.repository.pullRequests.nodes[]] | .[] | select(
reduce ( .[].data.repository.pullRequests.nodes[] | select(
.bodyText |
scan("(?:blocked (?:by|on)|stacked on):? #(?<num>[0-9]+)") |
scan("(?:blocked (?:by|on)|stacked on):? #([0-9]+)") |
map(tonumber) |
any(.[]; . == $pr)
)
)) as $i ([]; . + [$i])
'
)
echo "deps=$blocked_prs" >> "$GITHUB_OUTPUT"
echo "numdeps='$(jq -r '. | length' <<< "$blocked_prs")"
echo "numdeps=$(jq -r '. | length' <<< "$blocked_prs")" >> "$GITHUB_OUTPUT"
- name: Trigger Blocked PP Workflows for Dependants
if: fromJSON(steps.gather_deps.outputs.numdeps) > 0