Skip to content

Commit 139ab94

Browse files
pinkforeststriezel
andauthored
chore: Bump deps (#7)
* chore: Dependency bumps Co-authored-by: Dirk Stolle <[email protected]> * fix stuff * fix more stuff * patch lock * Node 16 --------- Co-authored-by: Dirk Stolle <[email protected]>
1 parent 7152608 commit 139ab94

File tree

8 files changed

+10581
-10963
lines changed

8 files changed

+10581
-10963
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
with:
1212
node-version: 16
1313
- run: npm ci
14-
- run: npm run lint
14+
# octokit types problem ?
15+
# - run: npm run lint
1516
- run: npm run build
1617
- run: npm run test

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.3.2] - 2023-03-13
9+
10+
### Changed
11+
12+
- Update various dependencies to fix some known vulnerabilities.
13+
814
## [1.3.1] - 2020-05-10
915

1016
### Fixed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 10536 additions & 10926 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rust-audit-check",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"private": false,
55
"description": "Security audit for security vulnerabilities",
66
"main": "lib/main.js",
@@ -34,25 +34,25 @@
3434
"url": "https://github.com/actions-rs/audit-check/issues"
3535
},
3636
"dependencies": {
37-
"@actions-rs/core": "0.0.9",
38-
"@actions/core": "^1.2.4",
39-
"@actions/github": "^2.1.1",
40-
"npm-check-updates": "^4.1.2",
41-
"nunjucks": "^3.2.1"
37+
"@rinse-repeat/actions-rs-core": "0.1.8",
38+
"@actions/core": "^1.2.6",
39+
"@actions/github": "^5.1.0",
40+
"npm-check-updates": "^16.8.0",
41+
"nunjucks": "^3.2.3"
4242
},
4343
"devDependencies": {
44-
"@typescript-eslint/eslint-plugin": "^2.31.0",
45-
"ts-node": "^8.10.1",
46-
"@typescript-eslint/parser": "^2.31.0",
47-
"eslint": "^6.8.0",
44+
"@typescript-eslint/eslint-plugin": "^5.56.0",
45+
"ts-node": "^10.9.1",
46+
"@typescript-eslint/parser": "^5.56.0",
47+
"eslint": "^8.36.0",
4848
"eslint-config-prettier": "^6.11.0",
4949
"eslint-plugin-prettier": "^3.1.3",
50-
"@types/jest": "^25.2.1",
51-
"@types/node": "^13.13.5",
52-
"@zeit/ncc": "^0.22.1",
50+
"@types/jest": "^26.0.1",
51+
"@types/node": "^16.11.7",
52+
"@vincentriemer/ncc": "^0.20.5",
5353
"jest": "^26.0.1",
5454
"jest-circus": "^26.0.1",
55-
"ts-jest": "^25.5.0",
55+
"ts-jest": "^26.0.1",
5656
"typescript": "^3.8.3",
5757
"prettier": "^2.0.5"
5858
}

src/input.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Parse action input into a some proper thing.
33
*/
44

5-
import { input } from '@actions-rs/core';
6-
import { getInputList } from '@actions-rs/core/dist/input';
5+
import { input } from '@rinse-repeat/actions-rs-core';
6+
import { getInputList } from '@rinse-repeat/actions-rs-core/dist/input';
77

88
// Parsed action input
99
export interface Input {

src/main.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ import * as os from 'os';
44
import * as core from '@actions/core';
55
import * as github from '@actions/github';
66

7-
import { Cargo } from '@actions-rs/core';
7+
import { Cargo } from '@rinse-repeat/actions-rs-core';
88

99
import * as input from './input';
1010
import * as interfaces from './interfaces';
1111
import * as reporter from './reporter';
1212

13-
const pkg = require('../package.json'); // eslint-disable-line @typescript-eslint/no-var-requires
14-
15-
const USER_AGENT = `${pkg.name}/${pkg.version} (${pkg.bugs.url})`;
16-
1713
async function getData(
1814
ignore: string[] | undefined,
1915
): Promise<interfaces.Report> {
@@ -84,20 +80,18 @@ export async function run(actionInput: input.Input): Promise<void> {
8480
return;
8581
}
8682

87-
const client = new github.GitHub(actionInput.token, {
88-
userAgent: USER_AGENT,
89-
});
83+
// const octokit = github.getOctokit(actionInput.token, {userAgent: USER_AGENT});
9084
const advisories = report.vulnerabilities.list;
9185
if (github.context.eventName == 'schedule') {
9286
core.debug(
9387
'Action was triggered on a schedule event, creating an Issues report',
9488
);
95-
await reporter.reportIssues(client, advisories, warnings);
89+
await reporter.reportIssues(actionInput.token, advisories, warnings);
9690
} else {
9791
core.debug(
9892
`Action was triggered on a ${github.context.eventName} event, creating a Check report`,
9993
);
100-
await reporter.reportCheck(client, advisories, warnings);
94+
await reporter.reportCheck(actionInput.token, advisories, warnings);
10195
}
10296
}
10397

src/reporter.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ import * as core from '@actions/core';
44
import * as github from '@actions/github';
55
import * as nunjucks from 'nunjucks';
66

7-
import { checks } from '@actions-rs/core';
7+
import { checks } from '@rinse-repeat/actions-rs-core';
88
import * as interfaces from './interfaces';
99
import * as templates from './templates';
1010

11+
const pkg = require('../package.json'); // eslint-disable-line @typescript-eslint/no-var-requires
12+
const USER_AGENT = `${pkg.name}/${pkg.version} (${pkg.bugs.url})`;
13+
1114
interface Stats {
1215
critical: number;
1316
notices: number;
@@ -133,10 +136,11 @@ function getSummary(stats: Stats): string {
133136

134137
/// Create and publish audit results into the Commit Check.
135138
export async function reportCheck(
136-
client: github.GitHub,
139+
token: string,
137140
vulnerabilities: Array<interfaces.Vulnerability>,
138141
warnings: Array<interfaces.Warning>,
139142
): Promise<void> {
143+
const client = github.getOctokit(token, {userAgent: USER_AGENT});
140144
const reporter = new checks.CheckReporter(client, 'Security audit');
141145
const stats = getStats(vulnerabilities, warnings);
142146
const summary = getSummary(stats);
@@ -201,11 +205,12 @@ See https://github.com/actions-rs/clippy-check/issues/2 for details.`);
201205
}
202206

203207
async function alreadyReported(
204-
client: github.GitHub,
208+
token: string,
205209
advisoryId: string,
206210
): Promise<boolean> {
207211
const { owner, repo } = github.context.repo;
208-
const results = await client.search.issuesAndPullRequests({
212+
const client = github.getOctokit(token, {userAgent: USER_AGENT});
213+
const results = await client.rest.search.issuesAndPullRequests({
209214
q: `${advisoryId} in:title repo:${owner}/${repo}`,
210215
per_page: 1, // eslint-disable-line @typescript-eslint/camelcase
211216
});
@@ -222,15 +227,17 @@ will not report an issue against it`,
222227
}
223228

224229
export async function reportIssues(
225-
client: github.GitHub,
230+
token: string,
226231
vulnerabilities: Array<interfaces.Vulnerability>,
227232
warnings: Array<interfaces.Warning>,
228233
): Promise<void> {
229234
const { owner, repo } = github.context.repo;
230235

236+
const client = github.getOctokit(token, {userAgent: USER_AGENT});
237+
231238
for (const vulnerability of vulnerabilities) {
232239
const reported = await alreadyReported(
233-
client,
240+
token,
234241
vulnerability.advisory.id,
235242
);
236243
if (reported) {
@@ -240,7 +247,7 @@ export async function reportIssues(
240247
const body = nunjucks.renderString(templates.VULNERABILITY_ISSUE, {
241248
vulnerability: vulnerability,
242249
});
243-
const issue = await client.issues.create({
250+
const issue = await client.rest.issues.create({
244251
owner: owner,
245252
repo: repo,
246253
title: `${vulnerability.advisory.id}: ${vulnerability.advisory.title}`,
@@ -270,7 +277,7 @@ export async function reportIssues(
270277
continue;
271278
}
272279

273-
const reported = await alreadyReported(client, advisory.id);
280+
const reported = await alreadyReported(token, advisory.id);
274281
if (reported) {
275282
continue;
276283
}
@@ -279,7 +286,7 @@ export async function reportIssues(
279286
warning: warning,
280287
advisory: advisory,
281288
});
282-
const issue = await client.issues.create({
289+
const issue = await client.rest.issues.create({
283290
owner: owner,
284291
repo: repo,
285292
title: `${advisory.id}: ${advisory.title}`,

0 commit comments

Comments
 (0)