From cf350bd700e26ba0e96993e24faac025920df888 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Sat, 15 Aug 2020 16:40:08 +0300 Subject: [PATCH] "ci(release): Add killswitch via issues w/ release-blocker label Implements https://app.asana.com/0/1169344595888357/1146357826982899/f which would cancel the workflow (stop the release) when the repo has open issues with the label 'release-blocker'". --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 704dcb5..89ba95f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,12 @@ jobs: runs-on: ubuntu-latest name: "Release a new version" steps: + - id: killswitch + if: ${{ !github.event.inputs.force }} + run: | + if curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY/issues?state=open&labels=release-blocker" | grep -Pzvo '\[[\s\n\r]*\]'; then + curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/$GITHUB_REPOSITORY/actions/runs/${{ github.run_id }}/cancel + fi - id: calver if: ${{ !github.event.inputs.version }} run: |