-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (62 loc) · 2.89 KB
/
lint.yml
File metadata and controls
68 lines (62 loc) · 2.89 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
61
62
63
64
65
66
67
68
name: Lint Scripts, Styles, and Texts
on:
workflow_call:
secrets:
CHECKOUT_TOKEN:
required: false
description: >
The GitHub token to authenticate checkout with. Pass in a GitHub personal access token if authenticated
submodules are used.
inputs:
cancel-workflow-on-failure:
description: When set to "true", it will cancel the current workflow run with all jobs if this workflow fails.
type: string
default: 'true'
scripts:
description: |
Information about the projects where JavaScript linting should occur. Can be in two formats:
- A comma separated list of relative paths to the project directories. These are the paths where a package.json
file could be, if desired. If there is no package.json on the provided path, the default one from this
repository is copied and the default asset subpath (./Assets/Scripts) is assumed. Using this approach, you have
to copy the assets to their final path (in ./wwwroot) using a different method, for example using the Copy
task in MSBuild.
- JSON object where the property names are the relative paths to the project directory where the package.json
file would be. For each path, a new package.json file is created from the template in this repository and then
the value of the property is placed into the $.nodejsExtensions path in the project file.
type: string
default: ''
styles-scss:
description: Information about the projects where SCSS linting should occur. Has the same format as the "scripts" input above.
type: string
default: ''
styles-css:
description: Information about the projects where CSS linting should occur. Has the same format as the "scripts" input above.
type: string
default: ''
lint-markdown:
description: Indicates if Markdown files should be linted in this repository.
type: string
default: 'true'
jobs:
lint:
name: Lint Scripts, Styles, and Texts
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev
with:
token: ${{ secrets.CHECKOUT_TOKEN }}
- name: Set up Node.js
uses: Lombiq/GitHub-Actions/.github/actions/setup-node@dev
- name: Run Linter
uses: Lombiq/NodeJs-Extensions/.github/actions/lint@dev
with:
scripts: ${{ inputs.scripts }}
styles-scss: ${{ inputs.styles-scss }}
styles-css: ${{ inputs.styles-css }}
lint-markdown: ${{ inputs.lint-markdown }}
- name: Cancel Workflow on Failure
if: failure() && inputs.cancel-workflow-on-failure == 'true'
uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}