Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow_run_attempt data to status report #1640

Merged
merged 3 commits into from
Apr 10, 2023

Conversation

angelapwen
Copy link
Contributor

@angelapwen angelapwen commented Apr 6, 2023

With this change, we begin reporting the workflow_run_attempt field in the status report base, using the GITHUB_RUN_ATTEMPT default environment variable (docs)

Similar to the workflow_run_id, we report -1 if the environment variable isn't found for whatever reason.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Previously we were implicitly converting `any` type to `string`; this does so explicitly.
@angelapwen angelapwen marked this pull request as ready for review April 6, 2023 22:12
@angelapwen angelapwen requested a review from a team as a code owner April 6, 2023 22:12
@@ -410,6 +412,11 @@ export async function createStatusReportBase(
if (workflowRunIDStr) {
workflowRunID = parseInt(workflowRunIDStr, 10);
}
const workflowRunAttemptStr = process.env["GITHUB_RUN_ATTEMPT"];
let workflowRunAttempt = -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to suggest undefined if not set, but if this is the convention we use for the workflow run ID, stick with it.

src/actions-util.ts Show resolved Hide resolved
adityasharad
adityasharad previously approved these changes Apr 10, 2023
@angelapwen angelapwen enabled auto-merge (squash) April 10, 2023 19:42
@angelapwen angelapwen merged commit 98f7bbd into github:main Apr 10, 2023
@angelapwen angelapwen deleted the workflow-run-attempt branch April 10, 2023 20:27
@github-actions github-actions bot mentioned this pull request Apr 13, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants