Skip to content

Commit ccec138

Browse files
Merge pull request #180 from dequelabs/main
chore: update `v1` branch from `main`
2 parents 307a1f7 + 786622a commit ccec138

File tree

13 files changed

+394
-85
lines changed

13 files changed

+394
-85
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @dequelabs/axe-api-team
1+
* @dequelabs/results-team

.github/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
open-pull-requests-limit: 10
9+
commit-message:
10+
prefix: "chore"
11+
groups:
12+
# Any updates not caught by the group config will get individual PRs
13+
gha-low-risk:
14+
update-types:
15+
- "minor"
16+
- "patch"
17+
18+
- package-ecosystem: "npm"
19+
directory: "/"
20+
schedule:
21+
interval: "monthly"
22+
open-pull-requests-limit: 10
23+
commit-message:
24+
prefix: "chore"
25+
ignore:
26+
# Handled separately by its own workflow
27+
- dependency-name: "@axe-core/watcher"
28+
groups:
29+
# Any updates not caught by the group config will get individual PRs
30+
npm-low-risk:
31+
update-types:
32+
- "minor"
33+
- "patch"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Add Documentation Labels on Issue Close (and completed)'
2+
3+
on:
4+
issues:
5+
types: [closed]
6+
7+
jobs:
8+
add-documentation-label:
9+
if: github.event.issue.state_reason == 'completed'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Add NEEDS document label
13+
uses: dequelabs/axe-api-team-public/.github/actions/label-issue-based-on-existing-labels-v1@main
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
issue-number: ${{ github.event.issue.number }}
17+
trigger-labels: 'Docs: required'
18+
add-labels: 'NEEDS: document'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Comment on related Zendesk tickets upon release
2+
#Description: Whenever the release branch is merged into main or master, call
3+
#the reusable_reach_out_to_zendesk_on_release_merge workflow in internal-actions-private.
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
jobs:
10+
notify-zendesk:
11+
uses: dequelabs/internal-actions-private/.github/workflows/reusable_reach_out_to_zendesk_on_release_merge.yml@main
12+
secrets: inherit
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Semantic PR footer
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- edited
9+
- synchronize
10+
11+
jobs:
12+
semantic-pr-footer:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 1
15+
steps:
16+
- uses: dequelabs/axe-api-team-public/.github/actions/semantic-pr-footer-v1@main

.github/workflows/tests.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
name: Tests
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
shellcheck:
77
runs-on: ubuntu-latest
8+
timeout-minutes: 1
89
steps:
9-
- uses: ludeeus/action-shellcheck@2.0.0
10+
- uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # tag=v2
1011
cypress:
1112
runs-on: ubuntu-latest
13+
timeout-minutes: 5
1214
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
1517
with:
1618
node-version: 18
1719
- run: cd example && npm install
18-
- uses: browser-actions/setup-chrome@latest
19-
- uses: nanasess/setup-chromedriver@v1
2020
- run: cd example && npm run build
2121
- name: Run tests
22-
uses: GabrielBB/xvfb-action@v1
22+
run: xvfb-run --auto-servernum npm run ci
23+
working-directory: ./example
2324
env:
2425
API_KEY: ${{ secrets.AXE_WATCHER_API_KEY }}
2526
SERVER_URL: https://axe.dequelabs.com
26-
with:
27-
run: npm run ci
28-
working-directory: ./example
29-
watcher:
27+
axe-dev-hub:
3028
runs-on: ubuntu-latest
29+
timeout-minutes: 5
3130
needs: cypress
3231
steps:
33-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
3433
- uses: ./
3534
with:
3635
api_key: ${{ secrets.AXE_WATCHER_API_KEY }}

.github/workflows/update-watcher.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,26 @@ on:
44
workflow_dispatch:
55
schedule:
66
# Scheduled to run at 2am every day
7-
- cron: '0 2 * * *'
7+
- cron: "0 2 * * *"
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 1
1213
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1516
with:
1617
node-version: 18
17-
- run: cd example && npm install --save-dev @axe-core/watcher@next
18+
- run: cd example && npm install --save-dev @axe-core/watcher@latest
1819
- name: Open PR
19-
uses: peter-evans/create-pull-request@v3
20+
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # tag=v5
2021
with:
2122
token: ${{ secrets.PAT }}
22-
commit-message: 'chore: Update @axe-core/watcher'
23+
commit-message: "chore: Update @axe-core/watcher"
2324
branch: auto-update-watcher
2425
base: main
25-
title: 'chore: Update @axe-core/watcher'
26+
title: "chore: Update @axe-core/watcher"
2627
body: |
27-
This patch updates version of [`@axe-core/watcher`](https://npmjs.org/@axe-core/watcher) to the latest `@next` version.
28+
This patch updates version of [`@axe-core/watcher`](https://npmjs.org/@axe-core/watcher) to the latest version.
2829
This PR was opened by a robot :robot: :tada:.

README.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
1-
# axe-watcher-action
1+
# axe-devhub-action
22

3-
> A GitHub Action for reporting the axe Watcher status of a particular commit.
3+
> A GitHub Action for reporting the axe DevHub status of a particular commit.
44
55
## Example Workflow
66

7-
A full example of the `axe-watcher-action` can be seen at [`.github/workflows/tests.yml`](./.github/workflows/tests.yml).
7+
A full example of the `axe-devhub-action` can be seen at [`.github/workflows/tests.yml`](./.github/workflows/tests.yml).
88

99
## Inputs
1010

11-
| name | description | required | default |
12-
| -------------- | ----------------------------------------------------------------------------------------------------------- | ------------------ | ---------------------- |
13-
| `api_key` | Your axe Watcher API key | :white_check_mark: | |
14-
| `server_url` | Axe server URL | :x: | https://axe.deque.com |
15-
| `retry_count` | Number of times to retry | :x: | 10 |
16-
| `github-token` | Optional [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) | :x: | `secrets.GITHUB_TOKEN` |
11+
| name | description | required | default |
12+
| ----------------------- |--------------------------------------------------------------------------------------------------------------------------|---------------------|-------------------------------------------------------------------------------------------|
13+
| `api_key` | Your axe Watcher API key | :white_check_mark: | |
14+
| `project_id` | The ID of your Axe Developer Hub project | :x: | Required for newer projects after December 9, 2025. Legacy projects will continue to work |
15+
| `server_url` | Axe server URL | :x: | https://axe.deque.com |
16+
| `retry_count` | Number of times to retry | :x: | 10 |
17+
| `github_token` | Optional [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) | :x: | `secrets.GITHUB_TOKEN` |
18+
| `enable_a11y_threshold` | Enable the a11y threshold, which will cause the action to fail if the number of violations is greater than the threshold | :x: | `false` |
1719

1820
## Outputs
1921

20-
| name | description |
21-
| ------------- | -------------------------------------------------- |
22-
| `project` | Project associated with your API key |
23-
| `axe_url` | URL for viewing axe issues detected on your commit |
24-
| `issue_count` | Number of axe issues detected |
22+
| name | description |
23+
| ---------------------------- |----------------------------------------------------|
24+
| `project` | Project name |
25+
| `project_id` | Project ID |
26+
| `axe_url` | URL for viewing axe issues detected on your commit |
27+
| `issue_count` | Number of axe issues detected |
28+
| `created_at` | DateTime when run occurred |
29+
| `resolved_issues` | Number of axe issues resolved |
30+
| `difference_in_page_states` | Difference in number of page states detected |
31+
| `page_states` | Number of page states detected |
32+
| `issues_over_a11y_threshold` | Number of issues over a11y threshold |

action.yml

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
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

44
inputs:
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

2128
outputs:
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

3245
runs:
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

Comments
 (0)