From bc1c38a4815d084bed3ef9cdb92cd979ffbd6d2e Mon Sep 17 00:00:00 2001 From: Braulio Rivas Abad Date: Tue, 14 May 2024 20:03:43 -0500 Subject: [PATCH] remove preview when pr not merged + don't force push --- .github/workflows/preview.yml | 8 ++++++++ .github/workflows/static.yml | 1 + 2 files changed, 9 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 0c5cc030..ce7152b7 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -13,8 +13,16 @@ jobs: steps: - uses: actions/checkout@v3 - uses: rossjrw/pr-preview-action@v1 + if: contains(['opened', 'reopened', 'synchronize'], ${{ github.event.action }}) with: source-dir: . preview-branch: gh-pages umbrella-dir: pr-preview action: auto + - uses: rossjrw/pr-preview-action@v1 + if: github.event.action == 'closed' && !github.event.pull_request.merged + with: + source-dir: . + preview-branch: gh-pages + umbrella-dir: pr-preview + action: remove diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index a1bdd882..f838e0f0 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -20,3 +20,4 @@ jobs: pr-preview/ beta/ target-folder: main/ + force: false