-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
90 lines (89 loc) · 4.06 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
name: 'Accessibility Insights Action'
description: 'Task to scan for accessibility issues'
inputs:
output-dir:
description: 'Folder containing the scan report.'
default: '_accessibility-reports'
required: true
static-site-dir:
description: 'Folder containing website content.'
default: ${{ github.workspace }}
required: true
static-site-url-relative-path:
description: 'Relative path to directory used to construct base scan url. e.g. / on Ubuntu and // on Windows'
required: true
default: '/'
chrome-path:
description: 'Path to Chrome executable.'
required: false
repo-token:
description: 'GitHub API access token.'
required: true
url:
description: 'The hosted URL to scan/crawl for accessibility issues.'
required: false
max-urls:
description: 'Maximum number of pages opened by crawler. The crawl will stop when this limit is reached.'
required: false
default: '100'
discovery-patterns:
description: 'List of RegEx patterns to crawl in addition to the provided URL, separated by space.'
required: false
input-file:
description: 'File path that contains list of URLs (each separated by a new line) to scan in addition to URLs discovered from crawling the provided URL.'
required: false
input-urls:
description: 'List of URLs to crawl in addition to URLs discovered from crawling the provided URL, separated by space.'
required: false
static-site-port:
description: 'The preferred local website TCP port to use when scanning local website content.'
required: false
scan-timeout:
description: 'The maximum timeout in milliseconds for the scan (excluding dependency setup)'
required: false
default: 90000
baseline-file:
description: 'The old baseline file path, a new baseline will be generated with the same name, if null baseline option will be disabled.'
required: false
single-worker:
description: 'To get deterministic scanning results, either specify the singleWorker parameter or ensure that the value specified for the maxUrls parameter is larger than the total number of urls in the web site being scanned.'
required: true
default: true
runs:
using: 'composite'
steps:
- name: Install npm packages
run: |
echo 'Installing npm packages...'
cd $GITHUB_ACTION_PATH/dist && yarn install --frozen-lockfile --production --ignore-optional --ignore-engines
echo 'npm packages successfully installed'
shell: bash
- name: Setup local docker container
run: |
if [[ $ACT == true && ! -f '/usr/bin/chromium' ]]; then
apt-get update \
&& apt-get -y install chromium chromium-l10n \
&& apt-get -y install procps
echo 'Chromium package successfully installed on docker container'
fi
shell: bash
- name: Run action
run: |
echo 'Starting accessibility scanner...'
node $GITHUB_ACTION_PATH/dist/index.js
shell: bash
env:
INPUT_OUTPUT-DIR: ${{ inputs.output-dir }}
INPUT_STATIC-SITE-DIR: ${{ inputs.static-site-dir }}
INPUT_STATIC-SITE-URL-RELATIVE-PATH: ${{ inputs.static-site-url-relative-path }}
INPUT_CHROME-PATH: ${{ inputs.chrome-path }}
INPUT_REPO-TOKEN: ${{ inputs.repo-token }}
INPUT_URL: ${{ inputs.url }}
INPUT_MAX-URLS: ${{ inputs.max-urls }}
INPUT_DISCOVERY-PATTERNS: ${{ inputs.discovery-patterns }}
INPUT_INPUT-FILE: ${{ inputs.input-file }}
INPUT_INPUT-URLS: ${{ inputs.input-urls }}
INPUT_STATIC-SITE-PORT: ${{ inputs.static-site-port }}
INPUT_SCAN-TIMEOUT: ${{ inputs.scan-timeout }}