style(format): format code with Prettier
This commit is contained in:
51
README.md
51
README.md
@@ -8,11 +8,13 @@ GitHub Action to run `npm audit`
|
||||
|
||||
### Create a Pull Request comment
|
||||
|
||||
If vulnerabilities are found by `npm audit`, Action triggered by PR creates a 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.
|
||||
If vulnerabilities are found by `npm audit`, Action triggered by push, schedule
|
||||
creates the following GitHub Issue.
|
||||
|
||||

|
||||
|
||||
@@ -20,26 +22,26 @@ If vulnerabilities are found by `npm audit`, Action triggered by push, schedule
|
||||
|
||||
### Inputs
|
||||
|
||||
|Parameter|Required|Default Value|Description|
|
||||
|:--:|:--:|:--:|:--|
|
||||
|audit_level|false|low|The value of `--audit-level` flag|
|
||||
|create_issues|false|true|Flag to create issues when vulnerabilities are found|
|
||||
|create_pr_comments|false|true|Flag to create pr comments when vulnerabilities are found|
|
||||
|dedupe_issues|false|false|Flag to de-dupe against open issues|
|
||||
|github_context|false|`${{ toJson(github) }}`|The `github` context|
|
||||
|github_token|true|N/A|GitHub Access Token.<br>${{ secrets.GITHUB_TOKEN }} is recommended.|
|
||||
|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|
|
||||
|json_flag|false|false|Run `npm audit` with `--json`|
|
||||
|production_flag|false|false|Run `npm audit` with `--omit=dev`|
|
||||
|working_directory|false|N/A|The directory which contains package.json|
|
||||
| Parameter | Required | Default Value | Description |
|
||||
| :----------------: | :------: | :-----------------------------: | :------------------------------------------------------------------ |
|
||||
| audit_level | false | low | The value of `--audit-level` flag |
|
||||
| create_issues | false | true | Flag to create issues when vulnerabilities are found |
|
||||
| create_pr_comments | false | true | Flag to create pr comments when vulnerabilities are found |
|
||||
| dedupe_issues | false | false | Flag to de-dupe against open issues |
|
||||
| github_context | false | `${{ toJson(github) }}` | The `github` context |
|
||||
| github_token | true | N/A | GitHub Access Token.<br>${{ secrets.GITHUB_TOKEN }} is recommended. |
|
||||
| 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 |
|
||||
| json_flag | false | false | Run `npm audit` with `--json` |
|
||||
| production_flag | false | false | Run `npm audit` with `--omit=dev` |
|
||||
| working_directory | false | N/A | The directory which contains package.json |
|
||||
|
||||
### Outputs
|
||||
|
||||
|Parameter name|Description|
|
||||
|:--:|:--|
|
||||
|npm_audit|The output of the npm audit report in a text format|
|
||||
| Parameter name | Description |
|
||||
| :------------: | :-------------------------------------------------- |
|
||||
| npm_audit | The output of the npm audit report in a text format |
|
||||
|
||||
## Example Workflow
|
||||
|
||||
@@ -77,13 +79,15 @@ jobs:
|
||||
|
||||
### Running Tests
|
||||
|
||||
This project uses [Vitest](https://vitest.dev/) for testing. To run the tests, use the following command:
|
||||
This project uses [Vitest](https://vitest.dev/) for testing. To run the tests,
|
||||
use the following command:
|
||||
|
||||
```bash
|
||||
npm run test
|
||||
```
|
||||
|
||||
Vitest will execute all test files and provide a detailed report of the results. For coverage reports, you can use:
|
||||
Vitest will execute all test files and provide a detailed report of the results.
|
||||
For coverage reports, you can use:
|
||||
|
||||
```bash
|
||||
npm run test:coverage
|
||||
@@ -95,6 +99,7 @@ Ensure all dependencies are installed before running the tests:
|
||||
npm ci
|
||||
```
|
||||
|
||||
- - -
|
||||
---
|
||||
|
||||
This action is inspired by [homoluctus/gitrivy](https://github.com/homoluctus/gitrivy).
|
||||
This action is inspired by
|
||||
[homoluctus/gitrivy](https://github.com/homoluctus/gitrivy).
|
||||
|
||||
Reference in New Issue
Block a user