File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,29 @@ runs:
68
68
env :
69
69
GH_TOKEN : ${{ inputs.gh_token }}
70
70
run : |
71
- prs=$(gh api \
72
- -H "Accept: application/vnd.github+json" \
73
- -H "X-GitHub-Api-Version: 2022-11-28" \
74
- /repos/${{ github.repository }}/commits/${{ github.sha }}/pulls)
71
+ data=$(gh api graphql \
72
+ -F owner='${{ github.repository_owner }}' \
73
+ -F name='${{ github.event.repository.name }}' \
74
+ -F ref='${{ github.sha }}' \
75
+ -F query='query($name: String!, $owner: String!, $ref: GitObjectID!) {
76
+ repository(owner: $owner, name: $name) {
77
+ object(oid: $ref) {
78
+ ...on Commit {
79
+ associatedPullRequests(first: 10) {
80
+ nodes {
81
+ number
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }')
88
+
89
+ prs=$(echo $data | jq -r '.data.repository.object.associatedPullRequests.nodes[].number')
75
90
76
91
echo "prs=$prs" >> $GITHUB_OUTPUT
77
92
echo "prs $prs"
93
+ echo "data $data"
78
94
79
95
- name : Get ther run URL
80
96
id : run
96
112
[View the run](${{ steps.run.outputs.url }})
97
113
EOF
98
114
99
- for pr in $(echo '${{ steps.prs.outputs.prs }}' | jq -r '.[].number' ); do
115
+ for pr in $(echo '${{ steps.prs.outputs.prs }}'); do
100
116
gh api \
101
117
--method POST \
102
118
-H "Accept: application/vnd.github.v3+json" \
Original file line number Diff line number Diff line change 33
33
fly_token : ${{ secrets.FLY_TOKEN }}
34
34
slack_webhook_url : ${{ secrets.SLACK_WEBHOOK_URL }}
35
35
gh_token : ${{ secrets.GITHUB_TOKEN }}
36
-
37
- - uses : ./.github/actions/link
You can’t perform that action at this time.
0 commit comments