-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 907 Bytes
/
Copy pathci.yml
File metadata and controls
38 lines (32 loc) · 907 Bytes
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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run Unit Tests
run: python3 -m unittest discover tests
automerge:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'julwrites' && github.event.pull_request.base.ref == 'main'
permissions:
contents: write
pull-requests: write
steps:
- name: Automerge PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
gh pr review --approve "$PR_URL" || true
gh pr merge --rebase --delete-branch "$PR_URL"