1- name : axe Watcher
2- description : Get the axe Watcher status for a commit
1+ name : axe DevHub
2+ description : Get the axe DevHub status for a commit
33
44inputs :
55 api_key :
6- description : axe Watcher API Key
6+ description : axe DevHub API Key
77 required : true
8+ project_id :
9+ description : the ID of your Axe Developer Hub project
10+ required : false
811 server_url :
912 description : axe server URL
1013 required : false
@@ -13,51 +16,77 @@ inputs:
1316 description : number of times to attempt fetching the commit status
1417 required : false
1518 default : 10
19+ enable_a11y_threshold :
20+ description : Enable the a11y threshold, which will cause the action to fail if the number of violations is greater than the threshold
21+ required : false
22+ default : " false"
1623 github_token :
1724 description : GitHub token
25+ required : false
1826 default : ${{ github.token }}
19- required : true
2027
2128outputs :
2229 project :
2330 description : Project name
2431 value : ${{ steps.main.outputs.project }}
32+ project_id :
33+ description : Project ID
34+ value : ${{ steps.main.outputs.project_id }}
2535 axe_url :
2636 description : Axe URL for the commit's issues
2737 value : ${{ steps.main.outputs.axe_url }}
2838 issue_count :
2939 description : Number of violations found
3040 value : ${{ steps.main.outputs.issue_count }}
41+ issues_over_a11y_threshold :
42+ description : Whether the number of violations is over your a11y threshold
43+ value : ${{ steps.main.outputs.issues_over_a11y_threshold }}
3144
3245runs :
3346 using : composite
3447 steps :
35- - uses : jwalton/gh-find-current-pr@v1
48+ - name : Find current PR
49+ uses : jwalton/gh-find-current-pr@89ee5799558265a1e0e31fab792ebb4ee91c016b # tag=v1.3.3
3650 id : find_pr
37- - id : main
51+ - name : Get axe DevHub commit overview
52+ id : main
3853 run : ${{ github.action_path }}/main.sh
3954 shell : bash
4055 env :
4156 API_KEY : ${{ inputs.api_key }}
4257 SERVER_URL : ${{ inputs.server_url }}
4358 RETRY_COUNT : ${{ inputs.retry_count }}
4459 COMMIT_SHA : ${{ github.sha }}
45- # Add a comment reporting the number of violations.
46- - if : ${{ failure() }}
47- uses : marocchino/sticky-pull-request-comment@v2
60+ ENABLE_A11Y_THRESHOLD : ${{ inputs.enable_a11y_threshold }}
61+ PROJECT_ID : ${{ inputs.project_id }}
62+ - name : Add a comment with accessibility violations over a11y threshold into the current PR
63+ if : ${{ failure() && inputs.enable_a11y_threshold == 'true' }}
64+ uses : marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # tag=v2.9.4
65+ with :
66+ header : axe-devhub
67+ message : |
68+ axe DevHub found **${{ steps.main.outputs.issue_count }}** accessibility violations in this PR.
69+ axe DevHub found **${{ steps.main.outputs.issues_over_a11y_threshold }}** accessibility violations over your a11y threshold in this PR.
70+
71+ See the full report on [axe DevHub](${{ steps.main.outputs.axe_url }}).
72+ GITHUB_TOKEN : ${{ inputs.github_token }}
73+ number : ${{ steps.find_pr.outputs.pr }}
74+ - name : Add a comment with accessibility violations into the current PR
75+ if : ${{ failure() && inputs.enable_a11y_threshold == 'false' }}
76+ uses : marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # tag=v2.9.4
4877 with :
49- header : axe-watcher
78+ header : axe-devhub
5079 message : |
51- axe Watcher found **${{ steps.main.outputs.issue_count }}** accessibility violations in this PR.
80+ axe DevHub found **${{ steps.main.outputs.issue_count }}** accessibility violations in this PR.
5281
5382 See the full report on [axe DevHub](${{ steps.main.outputs.axe_url }}).
5483 GITHUB_TOKEN : ${{ inputs.github_token }}
5584 number : ${{ steps.find_pr.outputs.pr }}
56- # Hide a previously added comment if there are no violations.
57- - if : ${{ success() }}
58- uses : marocchino/sticky-pull-request-comment@v2
85+ - name : Hide a previously added comment if there are no violations.
86+ if : ${{ success() }}
87+ uses : marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # tag=v2.9.4
5988 with :
60- header : axe-watcher
89+ header : axe-devhub
6190 hide : true
6291 hide_classify : OUTDATED
6392 GITHUB_TOKEN : ${{ inputs.github_token }}
0 commit comments