diff --git a/.github/workflows/build-previews.yml b/.github/workflows/build-previews.yml index c4b02c64..96275cfd 100644 --- a/.github/workflows/build-previews.yml +++ b/.github/workflows/build-previews.yml @@ -25,6 +25,7 @@ jobs: await script({ github, context, core }) - name: Find comment + if: ${{ steps.get-workflow-artifacts.outputs.conclusion != 'cancelled' }} uses: peter-evans/find-comment@v2 id: find-comment with: @@ -33,6 +34,7 @@ jobs: body-includes: '' - name: Add/Update comment + if: ${{ steps.get-workflow-artifacts.outputs.conclusion != 'cancelled' }} uses: peter-evans/create-or-update-comment@v2 with: token: ${{ secrets.PAT }} diff --git a/scripts/get-workflow-artifacts.cjs b/scripts/get-workflow-artifacts.cjs index ed64d936..bb87d0f2 100644 --- a/scripts/get-workflow-artifacts.cjs +++ b/scripts/get-workflow-artifacts.cjs @@ -53,6 +53,12 @@ module.exports = async ({ github, context, core }) => { const template = await fs.readFile('./scripts/templates/build-status.md', 'utf8') const tableRows = [] + core.setOutput('conclusion', conclusion) + + if (conclusion === 'cancelled') { + return + } + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner, repo,