https://github.com/nextcloud-libraries/npm-audit-action
Run npm audit and get formatted output
https://github.com/nextcloud-libraries/npm-audit-action
Last synced: 10 months ago
JSON representation
Run npm audit and get formatted output
- Host: GitHub
- URL: https://github.com/nextcloud-libraries/npm-audit-action
- Owner: nextcloud-libraries
- License: mit
- Created: 2024-04-26T10:20:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-28T18:27:48.000Z (12 months ago)
- Last Synced: 2025-06-07T21:06:48.375Z (11 months ago)
- Language: TypeScript
- Size: 559 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS.md
Awesome Lists containing this project
README
# NPM audit action
[](https://api.reuse.software/info/github.com/nextcloud-libraries/npm-audit-action)
[](https://github.com/susnux/npm-audit-action/actions/workflows/codeql-analysis.yml)

This action allows to run `npm audit` and creats a Markdown formatted output from it, it also allows to run `npm audit fix` afterwards.
The idea is to run this action together with the [create-pull-request](https://github.com/marketplace/actions/create-pull-request) action.
## Usage
```yaml
- uses: actions/checkout@v4
- name: Run NPM audit
id: npm-audit
uses: susnux/npm-audit-action
with:
# Optionally set an output path
output-path: pr-content.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
body: ${{ steps.npm-audit.outputs.markdown }}
# Alternativly use the output file
body-path: pr-content.md
```
### Action inputs
| Name | Description | Default |
| ------------------- | --------------------------------------------- | ----------------------------- |
| `fix` | If `npm audit fix` should be executed instead | `true` |
| `output-path` | Output path for formatted markdown | By default no file is created |
| `working-directory` | Path to run `npm audit` | `GITHUB_WORKSPACE` |
### Action outputs
| Name | Description |
| ---------------------- | -------------------------------------------------------------- |
| `markdown` | The formatted markdown output |
| `issues-total` | Total number of issues found |
| `issues-fixable` | Number of issues fixable with `npm audit fix` |
| `issues-force-fixable` | Number of issues manually fixable with `npm audit fix --force` |
| `issues-unfixable` | Number of issues not fixable with `npm audit fix` |