-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (57 loc) · 1.65 KB
/
ci.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
47
48
49
50
51
52
53
54
55
56
57
name: CI
on: pull_request
jobs:
setup:
name: Set Up
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install zsh
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y zsh curl make git
- uses: actions/checkout@v4
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: setup
run: |
echo "PR was created by: ${{ github.event.pull_request.user.login }}"
make all
- name: Reboot shell
run: |
source ~/.zshenv
source ~/.zshrc
# https://github.com/actions/virtual-environments/issues/264#issuecomment-574032011
# use zsh
shell: zsh {0}
status-check:
runs-on: ubuntu-latest
needs:
- setup
permissions: {}
if: failure()
steps:
- run: exit 1
enable-auto-merge:
runs-on: ubuntu-latest
permissions:
contents: write # For enable automerge
pull-requests: write # For enable automerge
if: |
github.event.pull_request.user.login == 'renovate[bot]' && contains(github.event.pull_request.body, ' **Automerge**: Enabled.')
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{secrets.GH_APP_ID}}
private_key: ${{secrets.GH_APP_PRIVATE_KEY}}
- run: gh -R "$GITHUB_REPOSITORY" pr merge --squash --auto --delete-branch "$PR_NUMBER"
env:
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}}
PR_NUMBER: ${{github.event.pull_request.number}}