1
0
mirror of synced 2026-01-04 09:06:46 -05:00

Correctly drill down to 'jobs' array (#21732)

This commit is contained in:
James M. Greene
2021-09-24 15:51:04 -05:00
committed by GitHub
parent fcd97d401f
commit 6e9e5ec855

View File

@@ -52,15 +52,18 @@ jobs:
with:
script: |
const { owner, repo } = context.repo
const { data: buildJobs } = await github.actions.listJobsForWorkflowRun({
const { data: { jobs: buildJobs } } = await github.actions.listJobsForWorkflowRun({
owner,
repo,
run_id: process.env.BUILD_RUN_ID,
filter: 'latest'
})
const wasCancelled = buildJobs.every(({ status, conclusion }) => {
return status === 'completed' && conclusion === 'cancelled'
})
const wasCancelled = (
buildJobs.length > 0 &&
buildJobs.every(({ status, conclusion }) => {
return status === 'completed' && conclusion === 'cancelled'
})
)
core.setOutput('cancelled', wasCancelled.toString())
- if: ${{ steps.check-workflow-run.outputs.cancelled == 'false' }}