Public Access
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26f9009348 | ||
|
|
d8774e016c |
@@ -104,6 +104,7 @@ For each new advisory (including informal) an issue will be created:
|
||||
| `token` | ✓ | [GitHub token], usually a `${{ secrets.GITHUB_TOKEN }}` | string | |
|
||||
| `ignore` | | Comma-separated list of advisory ids to ignore | string | |
|
||||
| `working-directory`| | The directory of the Cargo.toml / Cargo.lock files to scan. | string | `.` |
|
||||
| `new-issue-labels` | | Comma-separated list of Labes to be added to new issues | string | `.` |
|
||||
|
||||
[GitHub token]: https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+6
-1
@@ -8,6 +8,7 @@ import { input } from '@clechasseur/rs-actions-core';
|
||||
export interface Input {
|
||||
token: string;
|
||||
ignore: string[];
|
||||
new_issue_labels: string[];
|
||||
workingDirectory: string;
|
||||
}
|
||||
|
||||
@@ -15,6 +16,10 @@ export function get(): Input {
|
||||
return {
|
||||
token: input.getInput('token', { required: true }),
|
||||
ignore: input.getInputList('ignore', { required: false }),
|
||||
workingDirectory: input.getInput('working-directory', { required: false }) ?? '.',
|
||||
new_issue_labels: input.getInputList('new-issue-labels', {
|
||||
required: false,
|
||||
}),
|
||||
workingDirectory:
|
||||
input.getInput('working-directory', { required: false }) ?? '.',
|
||||
};
|
||||
}
|
||||
|
||||
+7
-1
@@ -54,6 +54,7 @@ function removeTrailingSlash(str) {
|
||||
}
|
||||
|
||||
export async function run(actionInput: input.Input): Promise<void> {
|
||||
const labels = actionInput.new_issue_labels;
|
||||
const ignore = actionInput.ignore;
|
||||
const workingDirectory = removeTrailingSlash(actionInput.workingDirectory);
|
||||
const report = await getData(ignore, workingDirectory);
|
||||
@@ -97,7 +98,12 @@ export async function run(actionInput: input.Input): Promise<void> {
|
||||
core.debug(
|
||||
'Action was triggered on a schedule event, creating an Issues report',
|
||||
);
|
||||
await reporter.reportIssues(actionInput.token, advisories, warnings);
|
||||
await reporter.reportIssues(
|
||||
actionInput.token,
|
||||
advisories,
|
||||
warnings,
|
||||
labels,
|
||||
);
|
||||
} else {
|
||||
core.debug(
|
||||
`Action was triggered on a ${github.context.eventName} event, creating a Check report`,
|
||||
|
||||
@@ -256,6 +256,7 @@ export async function reportIssues(
|
||||
token: string,
|
||||
vulnerabilities: Array<interfaces.Vulnerability>,
|
||||
warnings: Array<interfaces.Warning>,
|
||||
labels: string[],
|
||||
): Promise<void> {
|
||||
const { owner, repo } = github.context.repo;
|
||||
|
||||
@@ -278,6 +279,7 @@ export async function reportIssues(
|
||||
repo: repo,
|
||||
title: `${vulnerability.advisory.id}: ${vulnerability.advisory.title}`,
|
||||
body: body,
|
||||
labels,
|
||||
});
|
||||
core.info(
|
||||
`Created an issue for ${vulnerability.advisory.id}: ${issue.data.html_url}`,
|
||||
|
||||
Reference in New Issue
Block a user