-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
39 lines (36 loc) · 1.07 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
name: 'Lint Mapbox GL Style'
description: 'Lint Mapbox GL Style'
inputs:
style-paths:
description: 'Path of styles to lint'
required: true
outputs:
lint-message:
description: 'Lint message'
value: ${{ steps.run-lint.outputs.lint-message }}
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v2
with:
node-version: '14'
- id: install
name: Install dependencies
run: npm install github:stamen/mapbox-gl-style-linter#v0.1.3 --global
shell: bash
- id: run-lint
name: Run lint command
run: |
export LINTER_OUTPUT="$(mapbox-gl-style-lint ${{ inputs.style-paths }})"
LINTER_OUTPUT="${LINTER_OUTPUT//'%'/'%25'}"
LINTER_OUTPUT="${LINTER_OUTPUT//$'\n'/'%0A'}"
LINTER_OUTPUT="${LINTER_OUTPUT//$'\r'/'%0D'}"
echo "::set-output name=lint-message::$(echo "$LINTER_OUTPUT")"
shell: bash
- id: fail-on-message
name: Check failure
run: |
if [ "${{ steps.run-lint.outputs.lint-message }}" != "" ]
then exit 1
fi
shell: bash