-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.09 KB
/
format.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
# This confirms that the repo is properly formatted according
# to the information located in README-HEADER.md
name: Format
on:
pull_request:
# Run tests when PRs opened or updated
types: [opened, synchronize]
branches:
- main
concurrency: format-${{ github.base_ref }}
jobs:
format:
name: "Format"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: "Checkout"
uses: actions/checkout@main
- name: Setup asdf
uses: asdf-vm/actions/setup@v2
- name: Cache asdf
id: asdf-cache
uses: actions/cache@v3
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}
- name: Setup asdf
if: steps.asdf-cache.outputs.cache-hit != 'true'
uses: asdf-vm/actions/install@v2
- name: "Format"
run: ./scripts/format.sh
- name: "Confirm"
run: |
if [[ ! -z $(git status --porcelain) ]]; then
echo "Repo is not canonically formatted. Run ./scripts/format.sh"
exit 1
fi