-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.1 KB
/
main.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
name: Format
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.ACTIONS_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: '20.x'
token: ${{ secrets.ACTIONS_TOKEN }}
- run: npm ci
- run: npm run format
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply formatting changes
branch: ${{ github.head_ref }}
# - name: Notify failure
# if: failure()
# uses: actions/github-script@v4
# with:
# github-token: ${{ secrets.ACTIONS_TOKEN }}
# script: |
# github.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: 'Formatting failed. Please check the logs.'
# })