Opened 3 years ago
Closed 3 years ago
#54742 closed defect (bug) (fixed)
Fix GHA on first runs for new branches
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | Cc: |
Description
When a new branch is created and the GitHub actions triggered, the initial run fails. This is due to the "Get details about the previous workflow run" erroring out because a previous run doesn't yet exist for the new branch.
Props to @desrosj for actually finding and explaining this.
Change History (13)
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
3 years ago
This ticket was mentioned in PR #2506 on WordPress/wordpress-develop by desrosj.
3 years ago
#3
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/54742
#4
@
3 years ago
- Milestone changed from Awaiting Review to 6.0
I've attached a fix attempt.
The PR adds a check for the total_count
field found in the API response to ensure there is at least one response before attempting to access it.
If there are no previous runs, a default of failure
will be used. This will trigger the "fixed" job, which will post to Slack that the workflow is now passing.
#6
@
3 years ago
- Owner set to desrosj
- Resolution set to fixed
- Status changed from new to closed
In 53077:
3 years ago
#7
Merged into Core in https://core.trac.wordpress.org/changeset/53077.
#8
@
3 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Hmm, it appears [53077] did not work as expected: https://github.com/WordPress/wordpress-develop/runs/5839661200?check_suite_focus=true.
Reopening to investigate further.
#9
@
3 years ago
- Keywords needs-patch added; has-patch commit removed
Keyword maintenance to keep reports clean.
This ticket was mentioned in PR #2524 on WordPress/wordpress-develop by desrosj.
3 years ago
#10
- Keywords has-patch added; needs-patch removed
This attempts to simplify how the Slack Notifications workflow checks the previous outcome of a workflow run. Actions now have "run attempts", and this information is returned in a getWorkflowRun()
check. This run_attempt
number can be used to determine if a previous attempt has been made, and if so, the status can be grabbed.
Trac ticket: [](https://core.trac.wordpress.org/ticket/54742)
Removing
trunk
as the Version since is known past issue.