diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8438fd1..43ba286 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,11 +20,22 @@ jobs: echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_OUTPUT - name: Skip if exists + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_RUN_ID: ${{ github.run_id }} run: | LATEST_TAG="${{ steps.get_tag.outputs.LATEST_TAG }}" MY_RELEASE=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') if [[ "$LATEST_TAG" == "$MY_RELEASE" ]]; then - cancelled(); + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/$`{GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/force-cancel" + exit 0 + fi - uses: actions/checkout@v4