Fix bug where run attempt was reported as run ID (#1661)
This commit is contained in:
parent
dcf71cf79b
commit
8b12d99ee5
3 changed files with 3 additions and 3 deletions
2
lib/workflow.js
generated
2
lib/workflow.js
generated
|
|
@ -267,7 +267,7 @@ exports.getWorkflowRunID = getWorkflowRunID;
|
||||||
* Get the workflow run attempt number.
|
* Get the workflow run attempt number.
|
||||||
*/
|
*/
|
||||||
function getWorkflowRunAttempt() {
|
function getWorkflowRunAttempt() {
|
||||||
const workflowRunAttemptString = (0, util_1.getRequiredEnvParam)("GITHUB_RUN_ID");
|
const workflowRunAttemptString = (0, util_1.getRequiredEnvParam)("GITHUB_RUN_ATTEMPT");
|
||||||
const workflowRunAttempt = parseInt(workflowRunAttemptString, 10);
|
const workflowRunAttempt = parseInt(workflowRunAttemptString, 10);
|
||||||
if (Number.isNaN(workflowRunAttempt)) {
|
if (Number.isNaN(workflowRunAttempt)) {
|
||||||
throw new Error(`GITHUB_RUN_ATTEMPT must define a non NaN workflow run attempt. Current value is ${workflowRunAttemptString}`);
|
throw new Error(`GITHUB_RUN_ATTEMPT must define a non NaN workflow run attempt. Current value is ${workflowRunAttemptString}`);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -331,7 +331,7 @@ export function getWorkflowRunID(): number {
|
||||||
* Get the workflow run attempt number.
|
* Get the workflow run attempt number.
|
||||||
*/
|
*/
|
||||||
export function getWorkflowRunAttempt(): number {
|
export function getWorkflowRunAttempt(): number {
|
||||||
const workflowRunAttemptString = getRequiredEnvParam("GITHUB_RUN_ID");
|
const workflowRunAttemptString = getRequiredEnvParam("GITHUB_RUN_ATTEMPT");
|
||||||
const workflowRunAttempt = parseInt(workflowRunAttemptString, 10);
|
const workflowRunAttempt = parseInt(workflowRunAttemptString, 10);
|
||||||
if (Number.isNaN(workflowRunAttempt)) {
|
if (Number.isNaN(workflowRunAttempt)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue