We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27cc61a commit 2c501ecCopy full SHA for 2c501ec
1 file changed
.github/workflows/re-trigger-approvals.yml
@@ -0,0 +1,21 @@
1
+on:
2
+ workflow_call:
3
+ inputs:
4
+ head_sha:
5
+ type: string
6
+ required: true
7
+
8
+jobs:
9
+ re-trigger:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ actions: write
13
+ steps:
14
+ - env:
15
+ GH_TOKEN: ${{ github.token }}
16
+ HEAD_SHA: ${{ inputs.head_sha }}
17
+ run: |
18
+ run_id=$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs?event=pull_request&head_sha=${HEAD_SHA}" \
19
+ --jq '.workflow_runs[] | select(.name == "Verified Approvals") | .id' \
20
+ | head -1)
21
+ [[ -n "${run_id}" ]] && gh api --method POST "repos/${GITHUB_REPOSITORY}/actions/runs/${run_id}/rerun"
0 commit comments