chore(deps): update npm dev (major) (#753)

Redo of https://github.com/slsa-framework/slsa-verifier/pull/654

- Fix dev-dependencies related to es-lint that the renovate-bot couldn't
auto-fix

- a few commas automatically added by the new linter

- use node20 for tests to avoid caompatibility warnings

```
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/parser@7.5.0',
npm WARN EBADENGINE   required: { node: '^18.18.0 || >=20.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
```

---------

Signed-off-by: Mend Renovate <bot@renovateapp.com>
Signed-off-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
This commit is contained in:
Ramon Petgrave
2024-04-02 17:44:08 -07:00
committed by GitHub
co-authored by Mend Renovate
parent 0547bc3002
commit bcc39bf21a
6 changed files with 686 additions and 562 deletions
+2 -2
View File
@@ -13,10 +13,10 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set Node.js 16
- name: Set Node.js 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 16
node-version: 20
- name: Rebuild the dist/ directory
working-directory: actions/installer
File diff suppressed because one or more lines are too long
+659 -536
View File
File diff suppressed because it is too large Load Diff
+9 -8
View File
@@ -23,13 +23,14 @@
"nodejs": "^0.0.0"
},
"devDependencies": {
"@types/jasmine": "4.3.2",
"@types/node": "18.16.17",
"@vercel/ncc": "0.36.1",
"eslint": "8.42.0",
"eslint-plugin-github": "4.8.0",
"jasmine": "5.0.1",
"prettier": "2.8.8",
"typescript": "5.1.3"
"@types/jasmine": "4.6.4",
"@types/node": "18.19.28",
"@vercel/ncc": "0.38.1",
"eslint": "^8.57.0",
"eslint-plugin-github": "4.10.2",
"eslint-plugin-prettier": "^5.1.3",
"jasmine": "5.1.0",
"typescript": "^5.4.3",
"typescript-eslint": "^7.5.0"
}
}
+5 -5
View File
@@ -29,8 +29,8 @@ describe("Test validVersion", function () {
it("Rejects commit hashes", function () {
expect(
index.validVersion(
"1326430d044e8a9522c51e5f721e237b5f75acb6b4e518d129f669403cf7a79a"
)
"1326430d044e8a9522c51e5f721e237b5f75acb6b4e518d129f669403cf7a79a",
),
).toBe(false);
});
});
@@ -55,15 +55,15 @@ describe("Test fileHasExpectedSha256Hash", function () {
it("Returns false when the computed and expected hashes don't match", function () {
expect(index.fileHasExpectedSha256Hash(this.testFile, "foobar")).toBe(
false
false,
);
});
it("Returns true when the computed and expected hashes don't match", function () {
expect(
index.fileHasExpectedSha256Hash(
this.testFile,
"916f0027a575074ce72a331777c3478d6513f786a591bd892da1a577bf2335f9"
)
"916f0027a575074ce72a331777c3478d6513f786a591bd892da1a577bf2335f9",
),
).toBe(true);
});
});
+10 -10
View File
@@ -49,7 +49,7 @@ export async function getVerifierVersion(actionRef: string): Promise<string> {
{
owner: "slsa-framework",
repository: "slsa-verifier",
}
},
);
for (const tag of tags) {
const commitSha = tag.commit.sha;
@@ -59,14 +59,14 @@ export async function getVerifierVersion(actionRef: string): Promise<string> {
}
}
throw new Error(
`Invalid version provided: ${actionRef}. For the set of valid versions, see https://github.com/slsa-framework/slsa-verifier/releases.`
`Invalid version provided: ${actionRef}. For the set of valid versions, see https://github.com/slsa-framework/slsa-verifier/releases.`,
);
}
// If true, then the file in `path` has the same SHA256 hash as `expectedSha256Hash``.
export function fileHasExpectedSha256Hash(
filePath: string,
expectedSha256Hash: string
expectedSha256Hash: string,
): boolean {
if (!fs.existsSync(filePath)) {
throw new Error(`File not found: ${filePath}`);
@@ -100,7 +100,7 @@ async function run(): Promise<void> {
} catch (error: unknown) {
const errMsg = error instanceof Error ? error.message : String(error);
core.setFailed(
`Invalid version provided. For the set of valid versions, see https://github.com/slsa-framework/slsa-verifier/releases. ${errMsg}`
`Invalid version provided. For the set of valid versions, see https://github.com/slsa-framework/slsa-verifier/releases. ${errMsg}`,
);
cleanup();
return;
@@ -115,7 +115,7 @@ async function run(): Promise<void> {
// Download bootstrap version and validate SHA256 checksum
bootstrapVerifierPath = await tc.downloadTool(
`https://github.com/slsa-framework/slsa-verifier/releases/download/${BOOTSTRAP_VERSION}/slsa-verifier-linux-amd64`,
`${bootstrapDir}/${BINARY_NAME}`
`${bootstrapDir}/${BINARY_NAME}`,
);
} catch (error: unknown) {
const errMsg = error instanceof Error ? error.message : String(error);
@@ -128,7 +128,7 @@ async function run(): Promise<void> {
!fileHasExpectedSha256Hash(bootstrapVerifierPath, BOOTSTRAP_VERIFIER_SHA256)
) {
core.setFailed(
`Unable to verify slsa-verifier checksum. Aborting installation.`
`Unable to verify slsa-verifier checksum. Aborting installation.`,
);
cleanup();
return;
@@ -141,7 +141,7 @@ async function run(): Promise<void> {
// Download requested version binary and provenance
downloadedBinaryPath = await tc.downloadTool(
`https://github.com/slsa-framework/slsa-verifier/releases/download/${version}/slsa-verifier-linux-amd64`,
`${installDir}/${BINARY_NAME}`
`${installDir}/${BINARY_NAME}`,
);
} catch (error: unknown) {
const errMsg = error instanceof Error ? error.message : String(error);
@@ -153,7 +153,7 @@ async function run(): Promise<void> {
try {
downloadedProvenancePath = await tc.downloadTool(
`https://github.com/slsa-framework/slsa-verifier/releases/download/${version}/slsa-verifier-linux-amd64.intoto.jsonl`,
`${installDir}/${PROVENANCE_NAME}`
`${installDir}/${PROVENANCE_NAME}`,
);
} catch (error: unknown) {
const errMsg = error instanceof Error ? error.message : String(error);
@@ -175,11 +175,11 @@ async function run(): Promise<void> {
"github.com/slsa-framework/slsa-verifier",
"--source-tag",
version,
]
],
);
if (exitCode !== 0) {
throw new Error(
`Unable to verify binary provenance. Aborting installation. stdout: ${stdout}; stderr: ${stderr}`
`Unable to verify binary provenance. Aborting installation. stdout: ${stdout}; stderr: ${stderr}`,
);
}
} catch (error: unknown) {