|
| 1 | +# NCM Report Github Action |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +This action generates and prints a project-wide report of directory risk and |
| 6 | +quality of installed or specified packages. |
| 7 | + |
| 8 | +## Inputs |
| 9 | + |
| 10 | +### `token` |
| 11 | + |
| 12 | +_Default_: `<empty>` |
| 13 | + |
| 14 | +**Required** Learn more about obtaining NodeSource service tokens and |
| 15 | +configuring permissions [here](https://docs.nodesource.com/ncm_v2/docs#ci-setup). |
| 16 | +We recommend you using repository [Secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) to store this value and use it in the workflow. |
| 17 | + |
| 18 | +### `long` |
| 19 | + |
| 20 | +_Default_: `no` |
| 21 | + |
| 22 | +**Optional** Set `yes` if you want the report display a list of all modules. |
| 23 | + |
| 24 | +### `compliance` |
| 25 | + |
| 26 | +_Default_: `no` |
| 27 | + |
| 28 | +**Optional** Set `yes` if you want the report only display non-compliant |
| 29 | +packages. |
| 30 | + |
| 31 | +### `security` |
| 32 | + |
| 33 | +_Default_: `no` |
| 34 | + |
| 35 | +**Optional** Set `yes` if you want the report only display packages with |
| 36 | +vulnerabilities. |
| 37 | + |
| 38 | +## Example usage |
| 39 | + |
| 40 | +This action can be used in the following scenarios: |
| 41 | + |
| 42 | +* Default report: |
| 43 | + |
| 44 | +``` |
| 45 | +uses: nodesource/ncm-report-github-action@master |
| 46 | +with: |
| 47 | + token: ${{ secrets.NCM_TOKEN }} |
| 48 | +``` |
| 49 | + |
| 50 | +* Long version of the report: |
| 51 | + |
| 52 | +``` |
| 53 | +uses: nodesource/ncm-report-github-action@master |
| 54 | +with: |
| 55 | + token: ${{ secrets.NCM_TOKEN }} |
| 56 | + long: 'yes' |
| 57 | +``` |
| 58 | + |
| 59 | +* Report with compliance only informaiton: |
| 60 | + |
| 61 | +``` |
| 62 | +uses: nodesource/ncm-report-github-action@master |
| 63 | +with: |
| 64 | + token: ${{ secrets.NCM_TOKEN }} |
| 65 | + compliance: 'yes' |
| 66 | +``` |
| 67 | + |
| 68 | +* Report with package vulnerabilities only informaiton: |
| 69 | + |
| 70 | +``` |
| 71 | +uses: nodesource/ncm-report-github-action@master |
| 72 | +with: |
| 73 | + token: ${{ secrets.NCM_TOKEN }} |
| 74 | + compliance: 'yes' |
| 75 | +``` |
| 76 | + |
| 77 | +To generate the report, `NCM` needs to get your `node_modules` folder to analyze |
| 78 | +and compare data, so, you might need to use more actions to get your code inside the |
| 79 | +workflow and the dependencies installed. We recommend you using: |
| 80 | + |
| 81 | +``` |
| 82 | +- uses: actions/checkout@v2 |
| 83 | +- run: npm install |
| 84 | +``` |
| 85 | + |
| 86 | +Feel free to check the workflow in `github/workflows/ncm-report.yml` for |
| 87 | +reference and real world usage example. |
0 commit comments