Skip to content

Commit 2c501ec

Browse files
BUILD-10590 Add re-trigger approvals workflow
1 parent 27cc61a commit 2c501ec

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)