From e72ba48a3b48779ac27edc8e35df1ff5fa96645b Mon Sep 17 00:00:00 2001 From: Cole Crawford <16374762+ColeDCrawford@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:15:15 -0400 Subject: [PATCH] Try using concurrency to cancel instead --- .github/workflows/build.yml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21e500102..108883477 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,10 @@ on: repository_dispatch: types: [build-trigger] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest @@ -24,24 +28,6 @@ jobs: npm install --legacy-peer-deps npm run build - - name: Cancel Previous Deployments - id: cancel_previous_deployments - uses: actions/github-script@v6 - with: - script: | - const deployments = await github.repos.listDeployments({ - owner: context.repo.owner, - repo: context.repo.repo - }); - const inProgressDeployments = deployments.data.filter(deployment => deployment.status === 'in_progress'); - for (const deployment of inProgressDeployments) { - await github.repos.deleteDeployment({ - owner: context.repo.owner, - repo: context.repo.repo, - deployment_id: deployment.id - }); - } - - name: Deploy uses: peaceiris/actions-gh-pages@v4 with: