diff --git a/action.yml b/action.yml index 49fed40..1c9b5c1 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ description: 'GitHub Action that uploads coverage reports for your repository to author: 'Ibrahim Ali <@ibrahim0814> & Thomas Hu <@thomasrockhu> | Codecov' inputs: name: - description: 'User defined upload name. Visible in Codecov UI' + description: 'User defined upload name. Visible in Codecov UI. Defaults to ${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}' required: false token: description: 'Repository upload token - get it from codecov.io. Required only for private repositories' diff --git a/dist/index.js b/dist/index.js index e21a16d..864ad9e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2267,6 +2267,7 @@ try { options.env = Object.assign(process.env, { GITHUB_ACTION: process.env.GITHUB_ACTION, GITHUB_RUN_ID: process.env.GITHUB_RUN_ID, + GITHUB_RUN_NUMBER: process.env.GITHUB_RUN_NUMBER, GITHUB_REF: process.env.GITHUB_REF, GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY, GITHUB_SHA: process.env.GITHUB_SHA, @@ -2307,8 +2308,17 @@ try { ); } + if (name) { + execArgs.push( + "-n", `${name}` + ); + } else { + execArgs.push( + "-n", `${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}` + ); + } + execArgs.push( - "-n", `${name}`, "-F", `${flags}` ); diff --git a/index.js b/index.js index c7fed3a..8ac80f6 100644 --- a/index.js +++ b/index.js @@ -63,6 +63,7 @@ try { options.env = Object.assign(process.env, { GITHUB_ACTION: process.env.GITHUB_ACTION, GITHUB_RUN_ID: process.env.GITHUB_RUN_ID, + GITHUB_RUN_NUMBER: process.env.GITHUB_RUN_NUMBER, GITHUB_REF: process.env.GITHUB_REF, GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY, GITHUB_SHA: process.env.GITHUB_SHA, @@ -103,8 +104,17 @@ try { ); } + if (name) { + execArgs.push( + "-n", `${name}` + ); + } else { + execArgs.push( + "-n", `${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}` + ); + } + execArgs.push( - "-n", `${name}`, "-F", `${flags}` ); diff --git a/package.json b/package.json index 77b9b1e..a643bb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codecov-action", - "version": "1.0.13", + "version": "1.0.14", "description": "Upload coverage reports to Codecov from GitHub Actions", "main": "index.js", "scripts": {