Skip to content

Commit

Permalink
Open a GitHub Issue if vulnerabilities are found (#8)
Browse files Browse the repository at this point in the history
* Get GitHub access token from input

* install npm package

* fix TypeScript error to successfully build

ref: actions/toolkit#199

* npm i strip-ansi to remove control characters

* create an issue

* use template literal to pass lint

* npm run format; npm run lint

* use inputs.issue_title as issue title

* document inputs.issue_title

* add inputs.issue_title
  • Loading branch information
oke-py authored Dec 8, 2019
1 parent 2167fa3 commit 02e2cee
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 50 deletions.
4 changes: 4 additions & 0 deletions @types/octokit/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '@octokit/graphql' {
export type Variables = any
export type GraphQlQueryResponse = any
}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# npm audit action

GitHub Action to run `npm audit`

## Usage

### Inputs

|Parameter|Required|Default Value|Description|
|:--:|:--:|:--:|:--|
|issue_title|false|npm audit found vulnerabilities|Issue title|
|token|true|N/A|GitHub Access Token.<br>${{ secrets.GITHUB_TOKEN }} is recommended.|
4 changes: 2 additions & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
describe('main', () => {
test.todo('Add a test suite');
});
test.todo('Add a test suite')
})
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: 'npm audit action'
description: 'run npm audit'
author: 'Naoki Oketani <okepy.naoki@gmail.com>'
inputs:
myInput: # change this
description: 'input description here'
default: 'default value if applicable'
token:
description: 'GitHub access token used to create an issue'
required: true
issue_title:
description: 'Issue title'
default: 'npm audit found vulnerabilities'
required: false
runs:
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit 02e2cee

Please sign in to comment.