Skip to content

Commit 893633f

Browse files
committed
1.1.0
1 parent fbc3a9f commit 893633f

File tree

6 files changed

+47
-48
lines changed

6 files changed

+47
-48
lines changed

.github/workflows/ncm-report.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
1-
name: NodeSource Certification process
2-
on: [push, pull_request]
1+
name: NodeSource Certification
2+
on: pull_request
33

44
jobs:
55
ncm_report:
66
runs-on: ubuntu-latest
7-
name: NodeSource Certification process
7+
name: N|S -> NCM Pipeline
88
steps:
99
- uses: actions/checkout@v2
1010
- run: npm install
11-
- name: Report without options
11+
- name: NCM Report
1212
id: report
13-
uses: nodesource/ncm-report-github-action@master
13+
uses: nodesource/ncm-report-github-action@v1.1.0
1414
with:
1515
token: ${{ secrets.NCM_TOKEN }}
16-
- name: Report with --long
17-
id: report_long
18-
uses: nodesource/ncm-report-github-action@master
19-
with:
20-
token: ${{ secrets.NCM_TOKEN }}
21-
long: 'yes'
22-
- name: Report with --compliance
23-
id: report_compliance
24-
uses: nodesource/ncm-report-github-action@master
25-
with:
26-
token: ${{ secrets.NCM_TOKEN }}
27-
compliance: 'yes'
28-
- name: Report with --security
29-
id: report_security
30-
uses: nodesource/ncm-report-github-action@master
31-
with:
32-
token: ${{ secrets.NCM_TOKEN }}
33-
security: 'yes'
16+
github_token: ${{ secrets.GITHUB_TOKEN }}
17+
github_job_name: N|S -> NCM Pipeline

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LABEL homepage="https://nodesource.com"
66
LABEL maintainer="NodeSource"
77

88
RUN apt-get update && apt-get install -y g++ build-essential
9-
RUN npm install -g ncm-cli
9+
RUN npm install -g nodesource/ncm-cli#gio/bump
1010

1111
COPY entrypoint.sh /entrypoint.sh
1212

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ _Default_: `no`
3535
**Optional** Set `yes` if you want the report only display packages with
3636
vulnerabilities.
3737

38+
### `github_token`
39+
40+
_Default_: `${{ secrets.GITHUB_TOKEN }}`
41+
42+
**Required** Set to pass the internal GitHub Token for NCM to update the check
43+
and make annotations. Use the default value (`${{ secrets.GITHUB_TOKEN }}`), you
44+
don't need to create any token in Secrets for this, GitHub automatically creates
45+
and sets this in the Action context.
46+
47+
### `github_job_name`
48+
49+
_Default_: `<empty>`
50+
51+
**Required** You need to set the same name you set to your job. If not,
52+
annotations will not be able to be included in your PR or RunCheck.
53+
3854
## Example usage
3955

4056
This action can be used in the following scenarios:
@@ -45,6 +61,8 @@ This action can be used in the following scenarios:
4561
uses: nodesource/ncm-report-github-action@master
4662
with:
4763
token: ${{ secrets.NCM_TOKEN }}
64+
github_token: ${{ secrets.GITHUB_TOKEN }}
65+
github_job_name: N|S -> NCM Pipeline
4866
```
4967

5068
* Long version of the report:
@@ -54,6 +72,8 @@ uses: nodesource/ncm-report-github-action@master
5472
with:
5573
token: ${{ secrets.NCM_TOKEN }}
5674
long: 'yes'
75+
github_token: ${{ secrets.GITHUB_TOKEN }}
76+
github_job_name: N|S -> NCM Pipeline
5777
```
5878

5979
* Report with compliance only informaiton:
@@ -63,6 +83,8 @@ uses: nodesource/ncm-report-github-action@master
6383
with:
6484
token: ${{ secrets.NCM_TOKEN }}
6585
compliance: 'yes'
86+
github_token: ${{ secrets.GITHUB_TOKEN }}
87+
github_job_name: N|S -> NCM Pipeline
6688
```
6789

6890
* Report with package vulnerabilities only informaiton:
@@ -72,11 +94,13 @@ uses: nodesource/ncm-report-github-action@master
7294
with:
7395
token: ${{ secrets.NCM_TOKEN }}
7496
compliance: 'yes'
97+
github_token: ${{ secrets.GITHUB_TOKEN }}
98+
github_job_name: N|S -> NCM Pipeline
7599
```
76100

77101
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:
102+
and compare data, so, you might need to use more actions to get your code inside
103+
the workflow and the dependencies installed. We recommend you using:
80104

81105
```
82106
- uses: actions/checkout@v2

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ inputs:
1616
description: 'Only display packages with vulnerabilities'
1717
required: false
1818
default: 'no'
19+
github_token:
20+
description: 'Send a Github Token'
21+
required: true
22+
default: ''
23+
github_job_name:
24+
description: 'Set the name of the job'
25+
required: true
1926

2027
runs:
2128
using: 'docker'
@@ -25,6 +32,8 @@ runs:
2532
- ${{ inputs.long }}
2633
- ${{ inputs.compliance }}
2734
- ${{ inputs.security }}
35+
- ${{ inputs.github_token }}
36+
- ${{ inputs.github_job_name }}
2837

2938
branding:
3039
icon: 'layers'

entrypoint.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
if [[ "$2" = "yes" ]]
44
then
5-
NCM_TOKEN=$1 ncm report --long
5+
FORCE_COLOR=3 IS_GITHUB_ACTION=true NCM_TOKEN=$1 ncm report --long
66
elif [[ "$3" = "yes" ]]
77
then
8-
NCM_TOKEN=$1 ncm report --compliance
8+
FORCE_COLOR=3 IS_GITHUB_ACTION=true NCM_TOKEN=$1 ncm report --compliance
99
elif [[ "$4" = "yes" ]]
1010
then
11-
NCM_TOKEN=$1 ncm report --security
11+
FORCE_COLOR=3 IS_GITHUB_ACTION=true NCM_TOKEN=$1 ncm report --security
1212
else
13-
NCM_TOKEN=$1 ncm report
13+
FORCE_COLOR=3 IS_GITHUB_ACTION=true NCM_TOKEN=$1 ncm report
1414
fi

package.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)