-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
69 lines (69 loc) · 2.99 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
64
65
66
67
68
69
name: 'Markdown link check log parser'
description: 'Parses the log from the gaurav-nelson/github-action-markdown-link-check action and outputs it as JSON or markdown.'
branding:
icon: file-text
color: blue
inputs:
auth-token:
description: 'GitHub token used to access workflow run logs.'
required: true
default: ${{ github.token }}
repo:
description: 'The repository for the workflow run in the format of {owner}/{repo}.'
required: true
default: ${{ github.repository }}
run-id:
description: 'The unique identifier of the workflow run that contains the markdown link check step.'
required: true
job-name:
description: 'The unique identifier of the workflow run that contains the markdown link check step.'
required: true
step-name:
description: 'Name of the markdown link check step.'
required: true
only-errors:
description: 'Whether the output information contains file errors only or all files.'
required: false
default: 'true'
output:
description: 'How to output the markdown file check result. It must be one of or a comma separated list of the following values: step-json, step-md file-json, file-md.'
required: false
default: 'step-json'
json-filepath:
description: 'The filepath for the output JSON file.'
required: false
default: ''
markdown-filepath:
description: 'The filepath for the output markdown file.'
required: false
default: ''
outputs:
mlc-result:
description: 'The result from the Markdown Link Check action in JSON format.'
runs:
using: 'docker'
image: 'docker://ghcr.io/edumserrano/markdown-link-check-log-parser:v1'
args:
- parse-log
- --auth-token
- ${{ inputs.auth-token }}
- --repo
- ${{ inputs.repo }}
- --run-id
- ${{ inputs.run-id }}
- --job-name
- ${{ inputs.job-name }}
- --step-name
- ${{ inputs.step-name }}
- --only-errors
- ${{ inputs.only-errors }}
- --output
- ${{ inputs.output }}
# The syntax for the optional parameters uses a kind of way of doing a ternary operator. See https://github.com/actions/runner/issues/409
# I don't want to include them in the call to the CLI if the values are the default empty value. Or else the CLI will say the value for that option is missing
# So if the optional action inputs below are equal to '' I set them to the default of a space ' ' and then on the entrypoint.ps1 I remove any arg that is empty or whitespace before doing the CLI call
# Note: can't set to an empty string '' instead of a space ' ' because then the ternary operator doesn't work, it will always evaluate to the right hand side of the ||. See https://github.com/actions/runner/issues/409#issuecomment-1013325196
- ${{ inputs.json-filepath == '' && ' ' || '--json-filepath' }}
- ${{ inputs.json-filepath == '' && ' ' || inputs.json-filepath }}
- ${{ inputs.markdown-filepath == '' && ' ' || '--markdown-filepath' }}
- ${{ inputs.markdown-filepath == '' && ' ' || inputs.markdown-filepath }}