add runAttempt to s3Prefix

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
This commit is contained in:
Eli Uriegas 2022-03-22 12:06:55 -07:00
parent 0504774707
commit eb9aade5ca
4 changed files with 8 additions and 2 deletions

4
dist/index.js vendored
View file

@ -31197,7 +31197,9 @@ function run() {
}
core.debug(`Resolved path is ${resolvedPath}`);
const s3 = new AWS.S3({ region: region });
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${name}/`;
// TODO: This is a temporary bandaid, see https://github.com/actions/toolkit/pull/1027
const runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10);
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${runAttempt}/${name}/`;
const s3Params = {
Bucket: s3Bucket,
Prefix: s3Prefix

1
package-lock.json generated
View file

@ -5,6 +5,7 @@
"requires": true,
"packages": {
"": {
"name": "download-artifact",
"version": "2.0.0",
"license": "MIT",
"dependencies": {

View file

@ -4,6 +4,7 @@
"description": "Download a build artifact that was previously uploaded in the workflow by the upload-artifact action",
"main": "dist/index.js",
"scripts": {
"all": "npm run format && npm run build && npm run release",
"build": "tsc",
"release": "ncc build src/download-artifact.ts",
"check-all": "concurrently \"npm:format-check\" \"npm:lint\" \"npm:build\"",

View file

@ -40,7 +40,9 @@ async function run(): Promise<void> {
}
core.debug(`Resolved path is ${resolvedPath}`)
const s3 = new AWS.S3({region: region})
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${name}/`
// TODO: This is a temporary bandaid, see https://github.com/actions/toolkit/pull/1027
const runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT as string, 10)
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${runAttempt}/${name}/`
const s3Params = {
Bucket: s3Bucket,
Prefix: s3Prefix