From aeaad356bf807c1d01cd987ec8312f5e06b61d1b Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 20 Sep 2022 13:32:20 +0800 Subject: [PATCH] Add `CI-no-fail-fast` label support --- .github/workflows/Build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index fa783f4..ffaa14b 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -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: @@ -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)) @@ -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) }}