Skip to content

Commit

Permalink
Return early if workflow gets cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
raducristianpopa committed Dec 11, 2023
1 parent e983aba commit e98d04b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-previews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -33,6 +34,7 @@ jobs:
body-includes: '<!-- __WM_EXTENSION_BUILD_PREVIEWS__ -->'

- name: Add/Update comment
if: ${{ steps.get-workflow-artifacts.outputs.conclusion != 'cancelled' }}
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PAT }}
Expand Down
6 changes: 6 additions & 0 deletions scripts/get-workflow-artifacts.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e98d04b

Please sign in to comment.