-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 63ca36e
Showing
13 changed files
with
11,683 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Test | ||
|
||
on: | ||
- workflow_dispatch | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
env: | ||
# For testing purposes, publish to this repository | ||
TARGET_REPO_NAME: dequelabs/action-vpat-publish | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- run: echo "content=$(cat test/vpat.html)" >> $GITHUB_ENV | ||
|
||
- name: Test publish action | ||
uses: ./ | ||
with: | ||
target-repo: ${{ env.TARGET_REPO_NAME }} | ||
target-repo-github-token: ${{ secrets.GITHUB_TOKEN }} | ||
target-repo-base-branch: main | ||
target-repo-vpat-directory: vpats | ||
product-id: test | ||
vpat-content: ${{ env.content }} | ||
|
||
- name: Test publish action again to simulate updating an existing PR | ||
uses: ./ | ||
with: | ||
target-repo: ${{ env.TARGET_REPO_NAME }} | ||
target-repo-github-token: ${{ secrets.GITHUB_TOKEN }} | ||
target-repo-base-branch: main | ||
target-repo-vpat-directory: vpats | ||
product-id: test | ||
vpat-content: ${{ env.content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/.DS_Store | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# action-vpat-publish | ||
|
||
*GitHub Action that publishes a VPAT report to a target repository* | ||
|
||
## Example workflow | ||
|
||
```yaml | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'vpats/*' | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout my product repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Convert most recent VPAT to HTML | ||
uses: dequelabs/action-vpat-to-html@main | ||
id: convert | ||
with: | ||
product-name: 'My Product' | ||
vpat-location: vpats | ||
|
||
- name: Publish VPAT to target repository | ||
uses: dequelabs/action-vpat-publish@main | ||
with: | ||
target-repo-github-token: ${{ secrets.VPAT_PUBLISH_REPO_GITHUB_TOKEN }} | ||
target-repo: <org-name>/<repo-name> | ||
product-id: my-product | ||
vpat-content: ${{ steps.convert.outputs.stringified-html }} | ||
``` | ||
## Inputs | ||
| Name | Description | Default | | ||
| --- | --- | --- | | ||
`target-repo-base-branch` | The base branch of the target repository. | `main` | | ||
`target-repo-github-token` | GitHub token to access the target repository. | | ||
`target-repo` | The GitHub repository to which the VPAT should be published. | | ||
`target-repo-vpat-directory` | Directory where the VPAT should be published in the target repository. | `static/vpats` | ||
`product-id` | Brief token that identifies your product. If publishing to the docs site, this should match the product ID used there. | | ||
`vpat-content` | The VPAT content to publish. | | ||
|
||
## Developer notes | ||
|
||
* The compiled `dist/` directory is committed to the `main` branch by running `yarn build` locally and committing the changes. The pre-commit hook should do this for you. | ||
|
||
## Testing | ||
|
||
To test your changes, push a commit to the remote repository and manually trigger the `Test` workflow on the desired branch using the workflow dispatch feature in the GitHub web interface. | ||
|
||
After the workflow has run, verify that the workflow successfully created a pull request called "Update VPAT for test" in this repository. Next, verify that the contents of the pull request are as expected - i.e., the test VPAT content added to `vpats/test.html`. | ||
|
||
After verifying the test results, close the pull request (do not merge). This ensures that future tests will not be affected by the test VPAT content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish VPAT | ||
description: Publish a VPAT to a target repository | ||
author: Deque Systems, Inc. | ||
|
||
inputs: | ||
target-repo-base-branch: | ||
description: The base branch of the target repository | ||
default: main | ||
target-repo-github-token: | ||
description: GitHub token to access the target repository | ||
required: true | ||
target-repo: | ||
description: The target GitHub repository | ||
required: true | ||
target-repo-vpat-directory: | ||
description: Directory where the VPAT should be published in the target repository | ||
default: static/vpats | ||
product-id: | ||
description: Brief token that identifies your product - should match product id in docs site | ||
required: true | ||
vpat-content: | ||
description: The VPAT content as a string of HTML without escape characters | ||
required: true | ||
|
||
runs: | ||
using: "node16" | ||
main: "dist/index.js" |
Oops, something went wrong.