-
-
Notifications
You must be signed in to change notification settings - Fork 106
38 lines (34 loc) · 1.15 KB
/
lint.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
name: Lint
on: workflow_call
permissions:
contents: write
jobs:
prettier:
timeout-minutes: 30
runs-on: ubuntu-latest
container:
image: node:18.15.0-alpine
steps:
- name: Install git
run: apk add git
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run prettier check
id: prettier_check
continue-on-error: true
run: |
trap 'echo "PRETTIER_EXIT_CODE=$?" >> $GITHUB_OUTPUT' EXIT; npm run prettify:check
- name: Fail if there no auto fix
if: steps.prettier_check.outputs.PRETTIER_EXIT_CODE == 2
run: exit 2
- name: Run prettier
id: prettier_run
if: steps.prettier_check.outputs.PRETTIER_EXIT_CODE == 1
run: |
json='{"commit_id": "b8f2b8b", "environment": "test", "tags_at_commit": "sometags", "project": "someproject", "current_date": "09/10/2014", "version": "someversion"}' && echo "$json" > versions.json
- uses: actions/upload-artifact@v4
name: status