Skip to content

Migrating from v5 to v6

Cyril Rohr edited this page Mar 13, 2026 · 1 revision

Migrating from v5 to v6

always_on was removed

PullPreview v6 no longer supports the v5 always_on behavior.

In v6, PullPreview is PR-centric:

  • labeled pull requests create or update previews
  • pushes to the PR branch redeploy the preview
  • removing the label destroys the preview
  • closing or merging the PR destroys the preview
  • optional schedule runs are only used for cleanup of dangling deployments

If you keep pullpreview/action@v6 in a workflow that runs directly on push for your default branch, it will not keep that branch deployed. Without a PR number, v6 falls back to branch cleanup behavior instead of deploying. See issue #131.

What to change in your workflow

When upgrading from v5:

  • remove the always_on input
  • do not use push to invoke pullpreview/action@v6 for deployments
  • keep pull_request events for deploy/update/destroy
  • keep schedule only if you want periodic cleanup of dangling resources

Example v6 workflow shape:

name: PullPreview
on:
  schedule:
    - cron: "30 */4 * * *"
  pull_request:
    types: [labeled, unlabeled, synchronize, closed, reopened, opened]

jobs:
  deploy:
    if: github.event_name == 'schedule' || github.event.label.name == 'pullpreview' || contains(github.event.pull_request.labels.*.name, 'pullpreview')
    runs-on: ubuntu-slim
    steps:
      - uses: actions/checkout@v6
      - uses: pullpreview/action@v6

Recommended replacement for a long-lived branch preview

If you used always_on to keep main, master, or staging continuously deployed, the recommended workaround in v6 is to use a long-lived PR that mirrors that branch:

  1. Create a dedicated branch such as preview-main.
  2. Open a PR from preview-main into your default branch and keep it open.
  3. Add your PullPreview trigger label to that PR.
  4. Sync preview-main from your default branch on every push.

That mirror push updates the PR head branch, which triggers a pull_request synchronize event and redeploys the preview in v6.

Example mirror workflow:

name: Sync preview branch
on:
  push:
    branches: [main]

permissions:
  contents: write

jobs:
  sync-preview-branch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - run: |
          git config user.name github-actions[bot]
          git config user.email 41898282+github-actions[bot]@users.noreply.github.com
          git checkout -B preview-main origin/main
          git push --force origin preview-main

Notes:

  • keep this mirroring workflow separate from the PullPreview workflow
  • trigger the mirroring workflow only from the source branch you want to mirror, to avoid loops
  • if you need multiple persistent environments, create one long-lived PR branch per environment

When to stay on v5 temporarily

If your current setup depends on branch-based always-on deploys and you cannot move to the PR-based workaround yet, staying on v5 temporarily is reasonable. Just treat that as a short-term stopgap, because the v6 docs and new features assume the PR-only model.

Clone this wiki locally