-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.49 KB
/
linting.yml
File metadata and controls
60 lines (50 loc) · 1.49 KB
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
58
59
60
name: Linting
on:
workflow_call:
inputs:
ref:
required: true
type: string
commit_changes:
required: false
type: boolean
default: false
defaults:
run:
working-directory: ./
permissions:
contents: read
jobs:
lint-format:
permissions:
contents: write
runs-on: ubuntu-latest
name: Reformat Code
steps:
- name: Harden runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.ref }}
- name: Setup Node
uses: actions/setup-node@v6
with:
cache: 'npm'
node-version-file: '.nvmrc'
- name: Install Dependencies
run: npm ci --no-progress
- name: Run Formatter
run: npm run format
- name: Commit Changes
if: ${{ inputs.commit_changes == true }}
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
with:
commit_message: 'style: Apply automated code formatting [skip ci]'
commit_options: '--no-verify'
repository: .
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>