Skip to content

Commit

Permalink
Add CI-no-fail-fast label support
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Sep 20, 2022
1 parent e57aa65 commit aeaad35
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
arch: ${{ steps.generate-matrix.outputs.arch }}
target: ${{ steps.generate-matrix.outputs.target }}
run-build: ${{ steps.generate-matrix.outputs.run-build }}
fail-fast: ${{ steps.generate-matrix.outputs.fail-fast }}
steps:
- uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -107,6 +108,20 @@ jobs:
core.setOutput('target', JSON.stringify(targetMatrix))
core.setOutput('run-build', 'false')
}
const matches = commitMessage.match(/(Try|Merge) #([0-9]+):/)
if (matches) {
const prNumber = matches[2]
const { data: { labels: labels } } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
})
const labelNames = labels.map(label => label.name)
if (labelNames.include('CI-no-fail-fast')) {
core.setOutput('fail-fast', 'false')
}
}
} else {
core.setOutput('arch', JSON.stringify(archMatrix))
core.setOutput('target', JSON.stringify(targetMatrix))
Expand Down Expand Up @@ -198,6 +213,7 @@ jobs:
if: ${{ needs.setup.outputs.run-build != 'false' }}
needs: setup
strategy:
fail-fast: ${{ needs.setup.outputs.fail-fast != 'false' }}
matrix:
os: ${{ fromJson(needs.setup.outputs.arch) }}
env: ${{ fromJson(needs.setup.outputs.target) }}
Expand Down

0 comments on commit aeaad35

Please sign in to comment.