Skip to content

Commit

Permalink
Merge branch 'master' into fix-4952
Browse files Browse the repository at this point in the history
  • Loading branch information
RustanLeino authored Jan 9, 2024
2 parents 51bd1ae + 7b12161 commit 43809c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check-deep-tests-reusable.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Check Deep Tests (Reusable Workflow)

on:
workflow_dispatch:
workflow_call:

jobs:
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/check-for-workflow-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ module.exports = async ({github, context, core, workflow_id, sha, ...config}) =>
const runFilterDesc = sha ? `${workflow_id} on ${sha}` : workflow_id
for (const run of result.data.workflow_runs) {
if ((!sha || run.head_sha === sha)) {
if (run.conclusion === "success") {
// The SHA is fully tested, exit with success
console.log(`Last run of ${runFilterDesc} succeeded: ${run.html_url}`)
return
} else if (run.status === "failure" || run.status === "timed_out") {
core.setFailed(`Last run of ${runFilterDesc} did not succeed: ${run.html_url}`)
return
// The status property can be one of: “queued”, “in_progress”, or “completed”.
if (run.status === "completed") {
// The conclusion property can be one of:
// “success”, “failure”, “neutral”, “cancelled”, “skipped”, “timed_out”, or “action_required”.
if (run.conclusion === "success") {
// The SHA is fully tested, exit with success
console.log(`Last run of ${runFilterDesc} succeeded: ${run.html_url}`)
return
} else if (run.conclusion === "failure" || run.conclusion === "timed_out") {
core.setFailed(`Last run of ${runFilterDesc} did not succeed: ${run.html_url}`)
return
}
}
}
}
Expand Down

0 comments on commit 43809c3

Please sign in to comment.