-
Notifications
You must be signed in to change notification settings - Fork 22
54 lines (50 loc) · 1.39 KB
/
format.yaml
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
name: Format
on:
# trigger on PR
pull_request:
# trigger manually
workflow_dispatch:
jobs:
# JOB to run change detection
detect_file_changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
markdown: ${{ steps.filter.outputs.markdown }}
frontend: ${{ steps.filter.outputs.bash }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
markdown:
- '**.md'
bash:
- '**.bash'
markdown:
needs: changes
if: ${{ needs.changes.outputs.markdown == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v2
- name: Format markdown with Deno
run: deno fmt *.md
- uses: stefanzweifel/git-auto-commit-action@v4
name: commit markdown file format
with:
commit_message: "chore: format markdown files"
bash:
needs: changes
if: ${{ needs.changes.outputs.bash == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v2
- name: Format bash with shfmt
run: ./scripts/format.bash
- uses: stefanzweifel/git-auto-commit-action@v4
name: commit markdown file format
with:
commit_message: "chore: format shell script files"