-
Notifications
You must be signed in to change notification settings - Fork 280
47 lines (41 loc) · 1.29 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: CI
on:
pull_request:
push:
branches: ["main"]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and branch
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Validate data and format JSON
id: validate
run: |
ROOT_DIR=${{ github.workspace }} ./format.sh
echo "status=$?" >> $GITHUB_OUTPUT
- name: Check for changes
if: steps.validate.outputs.status == '0'
id: diff
run: |
cd ${{ github.workspace }}
git diff --quiet . || (echo "Did you forget to run the latest 'format.sh' script?" && exit 1)
automerge:
runs-on: ubuntu-latest
needs: [validate]
if: |
github.event_name == 'pull_request' &&
github.repository == 'coinhall/yacar'
steps:
- name: auto-merge
uses: pascalgn/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_FILTER_AUTHOR: "yacarbot[bot]"
MERGE_LABELS: "status: done"
MERGE_METHOD: "squash"