mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Build/Test Tools: Prevent error when workflows run for new branches and tags.
This fixes a JavaScript error in the Slack notifications workflow. This was causing the first workflow run for each workflow in a new branch or tag to be reported as a failure, even if the important parts of the workflow succeed. When running a workflow for the first time, a default of `failure` is now used for the previous outcome. This will trigger a success notification to be sent to report successful branching/tagging. Props davidbaumwald. Fixes #54742. git-svn-id: https://develop.svn.wordpress.org/trunk@53077 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
8
.github/workflows/slack-notifications.yml
vendored
8
.github/workflows/slack-notifications.yml
vendored
@@ -94,7 +94,13 @@ jobs:
|
||||
per_page: 1,
|
||||
page: 2,
|
||||
});
|
||||
return previous_runs.data.workflow_runs[0].conclusion;
|
||||
|
||||
if ( previous_runs.data.total_count > 0 ) {
|
||||
return previous_runs.data.workflow_runs[0].conclusion;
|
||||
} else {
|
||||
// Use failure so all first time runs for a branch or tag are reported to Slack.
|
||||
return 'failure';
|
||||
}
|
||||
|
||||
- name: Store previous conclusion as an output
|
||||
id: previous-conclusion
|
||||
|
||||
Reference in New Issue
Block a user