-
Notifications
You must be signed in to change notification settings - Fork 366
46 lines (39 loc) · 1.24 KB
/
auto_approve.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: "Approve Workflow Runs"
on:
pull_request_target:
issue_comment:
types: [created, edited]
permissions:
contents: "read"
actions: "write"
jobs:
approve-workflow-runs:
name: "Check for approval"
runs-on: ubuntu-latest
if: |
github.event.pull_request.head.repo.owner.login != 'rerun-io' &&
(github.event_name == 'pull_request_target' || github.event.issue.pull_request)
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "PyGithub==1.59.0" "requests>=2.31,<3"
- name: Wait a few seconds
shell: bash
run: |
# Give GitHub a bit of time to synchronize everything
sleep 5s
- name: Approve workflow runs
shell: bash
run: |
python3 scripts/ci/approve_workflow_runs.py \
--github-token "${{ secrets.GITHUB_TOKEN }}" \
--github-repository "rerun-io/rerun" \
--pr-number "${{ github.event.pull_request.number || github.event.issue.number }}"