-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
63 lines (49 loc) · 1.48 KB
/
action.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
56
57
58
59
60
61
62
63
name: 'Reviewdog / Stylelint'
description: 'Lint code using stylelint'
inputs:
github-token:
description: 'Github token'
required: true
lint-path:
description: 'Stylelint input path'
default: './resources/**/*.{scss,vue}'
runs:
using: 'composite'
steps:
- name: Reset permissions
shell: bash
run: sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: Read .nvmrc
shell: bash
id: nvm
run: |
version=$(cat .nvmrc)
echo "NVMRC=$version" >> $GITHUB_OUTPUT
- name: Use Node.js ${{ steps.nvm.outputs.NVMRC }}
uses: actions/setup-node@v3
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Install yarn
shell: bash
run: npm install -g yarn
- name: Install dependencies
shell: bash
run: yarn install --pure-lockfile
env:
CI: true
- name: Reset permissions
shell: bash
run: sudo chown -R root:root $GITHUB_WORKSPACE
- name: Fix for https://github.com/reviewdog/action-stylelint/issues/78
shell: bash
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" || exit 1
- name: Stylelint
uses: reviewdog/action-stylelint@v1
with:
github_token: ${{ inputs.github-token }}
reporter: github-pr-review
stylelint_input: ${{ inputs.lint-path }}
- name: Reset permissions
shell: bash
run: sudo chown -R $USER:$USER $GITHUB_WORKSPACE