Skip to content

Commit f2d4acd

Browse files
Fix artifact uploading. (#13086)
Need to upgrade npm package. We need to test this first by rebuilding the docker image. Fixes google/clusterfuzz#4654
1 parent 322c9bf commit f2d4acd

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

infra/cifuzz/filestore/github_actions/upload.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,33 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
// Script for uploading an artifact. Returns 0 on success.
16-
// Usage: upload.js <aritfactName> <rootDirectory> <file 1>...<file N>
16+
// Usage: upload.js <artifactName> <rootDirectory> <file 1>...<file N>
1717

1818
const fs = require('fs');
19-
const artifact = require('@actions/artifact');
20-
const artifactClient = artifact.create()
19+
const { DefaultArtifactClient } = require('@actions/artifact');
20+
21+
const artifactClient = new DefaultArtifactClient();
2122
const artifactName = process.argv[2];
2223
const rootDirectory = process.argv[3]
2324
const files = process.argv.slice(4);
2425
const options = {
2526
continueOnError: true
26-
}
27+
};
2728

28-
const uploadResult = artifactClient.uploadArtifact(artifactName, files, rootDirectory, options)
29-
console.log(uploadResult);
30-
if (uploadResult['failedItems']) {
31-
return 1;
29+
async function uploadArtifact() {
30+
try {
31+
const uploadResult = await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);
32+
console.log(uploadResult);
33+
if (uploadResult.failedItems.length > 0) {
34+
return 1;
35+
}
36+
return 0;
37+
} catch (error) {
38+
console.error('Error uploading artifact:', error);
39+
return 1;
40+
}
3241
}
33-
return 0;
42+
43+
uploadArtifact().then(exitCode => {
44+
process.exit(exitCode);
45+
});

infra/cifuzz/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"author": "Google",
66
"license": "Apache2",
77
"dependencies": {
8-
"@actions/artifact": "1.1.1"
8+
"@actions/artifact": "^2.2.0"
99
}
1010
}

infra/run_fuzzers.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Docker image for running fuzzers on CIFuzz (the run_fuzzers action on GitHub
1717
# actions).
1818

19-
FROM gcr.io/oss-fuzz-base/cifuzz-base
19+
FROM gcr.io/oss-fuzz-base/cifuzz-base:metzman-test
2020

2121
# Python file to execute when the docker container starts up.
2222
# We can't use the env var $OSS_FUZZ_ROOT here. Since it's a constant env var,

0 commit comments

Comments
 (0)