Files
npm-audit-action/README.md

67 lines
1.5 KiB
Markdown
Raw Normal View History

2019-12-08 22:10:35 +09:00
# npm audit action
2019-12-08 19:17:13 +09:00
[![Coverage Status](https://coveralls.io/repos/github/oke-py/npm-audit-action/badge.svg?branch=master)](https://coveralls.io/github/oke-py/npm-audit-action?branch=master)
2019-12-08 22:10:35 +09:00
GitHub Action to run `npm audit`
2019-12-15 10:49:06 +09:00
## Feature
### Create a Pull Request comment
If vulnerabilities are found by `npm audit`, Action triggered by PR creates a comment.
### Create an Issue
If vulnerabilities are found by `npm audit`, Action triggered by push, schedule creates the following GitHub Issue.
2019-12-09 14:13:56 +09:00
![image](https://github.com/oke-py/npm-audit-action/blob/master/issue.png)
## Usage
### Inputs
|Parameter|Required|Default Value|Description|
|:--:|:--:|:--:|:--|
|issue_assignees|false|N/A|Issue assignees (separated by commma)|
|issue_labels|false|N/A|Issue labels (separated by commma)|
|issue_title|false|npm audit found vulnerabilities|Issue title|
|token|true|N/A|GitHub Access Token.<br>${{ secrets.GITHUB_TOKEN }} is recommended.|
### Outputs
N/A
## Example Workflow
2019-12-09 14:13:56 +09:00
```yaml
name: npm audit
2019-12-15 10:49:06 +09:00
on:
pull_request:
push:
branches:
- master
- 'releases/*'
2019-12-09 14:13:56 +09:00
# on:
# schedule:
# - cron: '0 10 * * *'
jobs:
scan:
name: npm audit
runs-on: ubuntu-latest
steps:
2020-01-27 20:48:43 +09:00
- uses: actions/checkout@v2
2019-12-09 14:13:56 +09:00
- name: install dependencies
run: npm ci
- uses: oke-py/npm-audit-action@v1.2.0
2019-12-09 14:13:56 +09:00
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
2019-12-09 14:13:56 +09:00
issue_assignees: oke-py
issue_labels: vulnerability,test
```
- - -
This action is inspired by [homoluctus/gitrivy](https://github.com/homoluctus/gitrivy).