-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
49 lines (43 loc) · 1.6 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
name: Run stylelint through yarn and upload report
description: |
Run a yarn task expecting stylelint reports to be produced. The exported reports will follow naming conventions
detailed by our ADRs (https://confluence.equisoft.com/display/HRMI/ADR).
A report named `build/stylelint/junit.xml` is expected under all circumstances.
Errors will be annotated on pull requests.
inputs:
report-name:
description: The name of the archived report. It must follow the convention detailed by our ADRs.
required: true
default: stylelint.junit.xml
report-retention-days:
description: Duration in days to preserve reports. Defaults to 5.
required: true
default: "5"
task-name:
description: The task name. Defaults to "stylelint:ci".
required: true
default: stylelint:ci
working-directory:
description: Relative path under $GITHUB_WORKSPACE where the project is located.
required: false
default: "."
runs:
using: composite
steps:
- name: Action context
shell: bash
id: context
run: |
echo "working-directory=$(realpath ${{ inputs.working-directory }})" >> $GITHUB_OUTPUT
- name: Run stylelint
shell: bash
working-directory: ${{ steps.context.outputs.working-directory }}
run: yarn ${{ inputs.task-name }}
- name: Upload report
uses: actions/upload-artifact@v4
if: "!cancelled()"
with:
name: ${{ inputs.report-name }}
retention-days: ${{ inputs.report-retention-days }}
if-no-files-found: error
path: ${{ steps.context.outputs.working-directory }}/build/stylelint/junit.xml