-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaction.yml
More file actions
82 lines (79 loc) · 2.73 KB
/
Copy pathaction.yml
File metadata and controls
82 lines (79 loc) · 2.73 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: axe DevHub
description: Get the axe DevHub status for a commit
inputs:
api_key:
description: axe DevHub API Key
required: true
project_id:
description: the ID of your Axe Developer Hub project
required: false
server_url:
description: axe server URL
required: false
default: https://axe.deque.com
retry_count:
description: number of times to attempt fetching the commit status
required: false
default: 10
enable_a11y_threshold:
description: Enable the a11y threshold, which will cause the action to fail if the number of violations is greater than the threshold
required: false
default: "false"
commit_sha:
description: Override the commit SHA to check status for
required: false
default: ${{ github.sha }}
github_token:
description: GitHub token
required: false
default: ${{ github.token }}
outputs:
project:
description: Project name
value: ${{ steps.main.outputs.project }}
project_id:
description: Project ID
value: ${{ steps.main.outputs.project_id }}
axe_url:
description: Axe URL for the commit's issues
value: ${{ steps.main.outputs.axe_url }}
issue_count:
description: Number of violations found
value: ${{ steps.main.outputs.issue_count }}
issues_over_a11y_threshold:
description: Whether the number of violations is over your a11y threshold
value: ${{ steps.main.outputs.issues_over_a11y_threshold }}
runs:
using: composite
steps:
- name: Get axe DevHub commit overview
id: main
run: ${{ github.action_path }}/main.sh
shell: bash
env:
API_KEY: ${{ inputs.api_key }}
SERVER_URL: ${{ inputs.server_url }}
RETRY_COUNT: ${{ inputs.retry_count }}
COMMIT_SHA: ${{ inputs.commit_sha }}
ENABLE_A11Y_THRESHOLD: ${{ inputs.enable_a11y_threshold }}
PROJECT_ID: ${{ inputs.project_id }}
- name: Add a comment with accessibility violations into the current PR
if: ${{ failure() }}
run: ${{ github.action_path }}/pr-comment.sh
shell: bash
env:
MODE: upsert
GITHUB_TOKEN: ${{ inputs.github_token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
ENABLE_A11Y_THRESHOLD: ${{ inputs.enable_a11y_threshold }}
ISSUE_COUNT: ${{ steps.main.outputs.issue_count }}
ISSUES_OVER_A11Y_THRESHOLD: ${{ steps.main.outputs.issues_over_a11y_threshold }}
AXE_URL: ${{ steps.main.outputs.axe_url }}
- name: Hide a previously added comment if there are no violations.
if: ${{ success() }}
run: ${{ github.action_path }}/pr-comment.sh
shell: bash
env:
MODE: hide
GITHUB_TOKEN: ${{ inputs.github_token }}
PR_NUMBER: ${{ github.event.pull_request.number }}