Skip to content

Commit

Permalink
feat: initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
isner committed Aug 11, 2023
0 parents commit e48a890
Show file tree
Hide file tree
Showing 15 changed files with 8,456 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test

on: push

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ./
id: convert_to_html
with:
product-name: 'Test Product'
vpat-location: 'test/vpats'

- run: echo -e ${{ steps.convert_to_html.outputs.stringified-html }} > vpat.html

- uses: actions/upload-artifact@v3
with:
name: result
path: vpat.html
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/.DS_Store
node_modules/
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn build
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# action-vpat-to-html

*GitHub Action that converts a VPAT report from markdown to styled HTML*

## 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_to_html
with:
product-name: 'My Product'
vpat-location: vpats

- name: Write HTML to file
run: echo -e ${{ steps.convert_to_html.outputs.stringified-html }} > vpat.html
```
## Inputs
| Name | Description | Default |
| --- | --- | --- |
`product-name` | A human-readable product name. This is used to generate a title for the resulting HTML document. |
`vpat-location` | The directory from which the most recent VPAT can be sourced. VPATs must be in markdown format. | `vpats`

## Outputs

| Name | Description |
| --- | --- |
| `stringified-html` | The generated HTML as a string. This value contains escape characters (e.g., `\n`). |

## Developer notes

* The compiled `dist/` directory is committed to the `main` branch by running `npm run build` locally and committing the changes. The pre-commit hook should do this for you.
* The `Test` workflow is triggered by every `push` event. Navigate to the workflow run page and open the `result` artifact to view the generated HTML.
19 changes: 19 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: VPAT to HTML
description: Convert a markdown VPAT report to HTML
author: Deque Systems, Inc.

inputs:
product-name:
description: Human-readable product name
required: true
vpat-location:
description: Path to directory containing VPATs
default: vpats

outputs:
stringified-html:
description: Stringified HTML content of VPAT report

runs:
using: "node16"
main: "dist/index.js"
Loading

0 comments on commit e48a890

Please sign in to comment.