Skip to content

Commit

Permalink
feat: add acot-reporter-github
Browse files Browse the repository at this point in the history
  • Loading branch information
wadackel committed Jan 3, 2022
1 parent c9f71c3 commit 5c8a235
Show file tree
Hide file tree
Showing 8 changed files with 702 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ acot has a feature which is divided into several packages.

### Reporters

| Package | Description |
| :------------------------------------------------------------- | :----------------------------------------------- |
| [@acot/acot-reporter-pretty](./packages/acot-reporter-pretty/) | An acot default reporter. |
| [@acot/acot-reporter-dot](./packages/acot-reporter-dot/) | A dot reporter for [@acot/cli](./packages/cli/). |
| Package | Description |
| :------------------------------------------------------------- | :------------------------------------------------ |
| [@acot/acot-reporter-pretty](./packages/acot-reporter-pretty/) | An acot default reporter. |
| [@acot/acot-reporter-dot](./packages/acot-reporter-dot/) | A dot reporter for [@acot/cli](./packages/cli/). |
| [@acot/acot-reporter-github](./packages/acot-reporter-github/) | GitHub reporter for [@acot/cli](./packages/cli/). |

### Utilities

Expand Down
1 change: 1 addition & 0 deletions packages/acot-reporter-github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/lib
41 changes: 41 additions & 0 deletions packages/acot-reporter-github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# @acot/acot-reporter-github

GitHub reporter for `@acot/cli`.

## Installation

Install via npm:

```bash
$ npm install --save @acot/acot-reporter-github
```

## Prerequisites

There are a few necessary setups for integrating acot with GitHub.

1. Install the [acot-a11y GitHub App](https://github.com/apps/acot-a11y) in the repository where you want to use GitHub integration.
1. Generate a token for GitHub integration from the [token manager application](https://gh-app.acot.dev).

## Usage

```javascript
module.exports = {
reporter: {
use: '@acot/github',
with: {
token: '...',
},
},
};
```

### Pass the token as an environment variable

If you pass a token to the `ACOT_GITHUB_APP_TOKEN` environment variable, the GitHub reporter will automatically resolve the token for you. It is one technique to avoid writing the token directly into the configuration file.

```javascript
module.exports = {
reporter: '@acot/github',
};
```
54 changes: 54 additions & 0 deletions packages/acot-reporter-github/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "@acot/acot-reporter-github",
"version": "0.0.1",
"description": "GitHub reporter for @acot/cli.",
"homepage": "https://github.com/acot-a11y/acot/tree/main/packages/acot-reporter-github",
"bugs": {
"url": "https://github.com/acot-a11y/acot/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/acot-a11y/acot.git",
"directory": "packages/acot-reporter-github"
},
"license": "MIT",
"author": "wadackel <wadackel@gmail.com>",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
"lib",
"!__mocks__",
"!__tests__"
],
"scripts": {
"build": "tsc",
"test": "jest"
},
"jest": {
"preset": "ts-jest",
"rootDir": "src",
"testEnvironment": "node",
"testMatch": [
"**/__tests__/**/*.test.ts?(x)"
]
},
"dependencies": {
"@acot/reporter": "0.0.13",
"@acot/schema-validator": "0.0.13",
"@sinclair/typebox": "^0.23.2",
"chalk": "^4.0.0",
"debug": "^4.3.1",
"env-ci": "6.0.0",
"got": "11.8.3"
},
"devDependencies": {
"@acot/factory": "0.0.13",
"@acot/mock": "0.0.13",
"@acot/types": "0.0.13",
"@types/env-ci": "^3.1.1",
"nock": "^13.2.1"
},
"publishConfig": {
"access": "public"
}
}

0 comments on commit 5c8a235

Please sign in to comment.