-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.41 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Lint
on:
push:
branches-ignore:
- 'main'
tags:
- '*'
workflow_dispatch:
permissions: write-all
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Declare commit sha variables
id: vars
shell: bash
run: echo "::set-output name=sha::$(echo ${GITHUB_SHA})"
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Node v16
uses: actions/setup-node@v2
with:
node-version: 16
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Check if changes were made
id: check-changes
run: |
if [ -z "$(git diff --name-only HEAD)" ]; \
then echo '::set-output name=changed::false'; \
else echo '::set-output name=changed::true'; fi
- name: Commit files
if: steps.check-changes.outputs.changed == 'true'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am ":rotating_light: Lint - ${{ steps.vars.outputs.sha }}"
- name: Push changes
if: steps.check-changes.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.gh_token }}
branch: ${{ github.ref }}