From 8fd5f01dd89c1c913d0e55f703f2b1a4a9555c4b Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Wed, 22 Apr 2026 18:49:08 -0400 Subject: [PATCH] delete preview links on merge --- .github/workflows/cleanup-preview.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/cleanup-preview.yml diff --git a/.github/workflows/cleanup-preview.yml b/.github/workflows/cleanup-preview.yml new file mode 100644 index 0000000..3935410 --- /dev/null +++ b/.github/workflows/cleanup-preview.yml @@ -0,0 +1,23 @@ +name: cleanup-preview + +on: + pull_request: + types: [closed] + +jobs: + cleanup: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Fern CLI + uses: fern-api/setup-fern-cli@v1 + + - name: Delete preview deployment + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + echo "Deleting preview for branch: ${{ github.head_ref }}" + fern docs preview delete --id "${{ github.head_ref }}" || echo "Preview deletion returned non-zero — it may already be gone"