2019-12-08 22:10:35 +09:00
|
|
|
# npm audit action
|
2019-12-08 19:17:13 +09:00
|
|
|
|
2019-12-08 22:10:35 +09:00
|
|
|
GitHub Action to run `npm audit`
|
2019-12-09 08:51:14 +09:00
|
|
|
|
2019-12-09 14:13:56 +09:00
|
|
|
If vulnerabilities are found by `npm audit`, it creates the following GitHub Issue.
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
2019-12-09 08:51:14 +09:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
### Inputs
|
|
|
|
|
|
|
|
|
|
|Parameter|Required|Default Value|Description|
|
|
|
|
|
|:--:|:--:|:--:|:--|
|
2019-12-09 12:43:13 +09:00
|
|
|
|issue_assignees|false|N/A|Issue assignees (separated by commma)|
|
|
|
|
|
|issue_labels|false|N/A|Issue labels (separated by commma)|
|
2019-12-09 08:51:14 +09:00
|
|
|
|issue_title|false|npm audit found vulnerabilities|Issue title|
|
|
|
|
|
|token|true|N/A|GitHub Access Token.<br>${{ secrets.GITHUB_TOKEN }} is recommended.|
|
2019-12-09 09:41:29 +09:00
|
|
|
|
|
|
|
|
### Outputs
|
|
|
|
|
|
|
|
|
|
N/A
|
|
|
|
|
|
|
|
|
|
## Example Workflow
|
|
|
|
|
|
2019-12-09 14:13:56 +09:00
|
|
|
```yaml
|
|
|
|
|
name: npm audit
|
|
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
# on:
|
|
|
|
|
# schedule:
|
|
|
|
|
# - cron: '0 10 * * *'
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
scan:
|
|
|
|
|
name: npm audit
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
- name: install dependencies
|
|
|
|
|
run: npm ci
|
|
|
|
|
- uses: oke-py/npm-audit-action@v0.1.0
|
|
|
|
|
with:
|
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
issue_assignees: oke-py
|
|
|
|
|
issue_labels: vulnerability,test
|
|
|
|
|
```
|