actions-marketplace-validations/Deploy PR Preview
Deploy a pull request preview to GitHub Pages, similar to Vercel and Netlify.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Maintainedlast commit Jan 20, 2026
- License
- MIT
Pinned Snippet
uses: actions-marketplace-validations/rossjrw_pr-preview-action@6f3a89d9ff1b752c6e781d91eacd27d9952188b0 # no releases — HEAD as of 2026-07-10tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| token | The token to use for the deployment. Default is GITHUB_TOKEN in the current repository. If you need more permissions for things such as deploying to another repository, you can add a Personal Access Token (PAT). | no | ${{ github.token }} |
| preview-branch | Branch on which the previews will be deployed. | no | gh-pages |
| umbrella-dir | Path to the directory containing all previews. | no | pr-preview |
| pages-base-url | URL of the repo's GitHub Pages site. | no | "" |
| pages-base-path | Path that GitHub Pages is served from. | no | "" |
| source-dir | Directory containing files to deploy. | no | . |
| pr-number | The PR number to use for the preview path. Defaults to the PR number from the GitHub event context. Override this for testing or when not triggered by a pull_request event. | no | "" |
| deploy-repository | The GitHub repository to deploy the preview to. This should be formatted like `<org name>/<repo name>`, e.g. `rossjrw/pr-preview-action`. Defaults to the current repository. You will need to add a Personal Access Token (PAT) in the `token` input in order to allow the action running in one repository to make changes to another repository. | no | ${{ github.repository }} |
| wait-for-pages-deployment | Whether to wait for GitHub Pages deployment before continuing, e.g. to ensure the preview URL is actually accessible when the sticky comment is posted. | no | false |
| comment | Whether to leave a sticky comment on the calling PR at the end of the workflow. | no | true |
| qr-code | URL to a QR code provider to generate a QR code for the preview URL in the comment. Preview URL will be appended to the string. Or, set to "false" to disable QR code generation. | no | https://qr.rossjrw.com/?color.dark=0d1117&url= |
| deploy-commit-message | The commit message to use when adding/updating a preview. | no | Deploy preview for PR ${{ github.event.number }} 🛫 |
| remove-commit-message | The commit message to use when removing a preview. | no | Remove preview for PR ${{ github.event.number }} 🛬 |
| git-config-name | The git user.name to use for the deployment commit. | no | — |
| git-config-email | The git user.email to use for the deployment commit. | no | — |
| custom-url | Deprecated, use `pages-base-url` instead. | no | "" |
| action | Determines what this action will do when it is executed. Supported values: `deploy`, `remove`, `auto` (default). If set to `deploy`, will attempt to deploy the preview and overwrite any existing preview in that location. If set to `remove`, will attempt to remove the preview in that location. If set to `auto`, the action will try to determine whether to deploy or remove the preview. It will deploy the preview on `pull_request.types.synchronize` and `.opened` events, and remove it on `pull_request.types.closed` events. It will not do anything for all other events. `auto` is the default value. | no | auto |
Outputs
| name | description |
|---|---|
| deployment-action | Resolved value of the 'action' input parameter (deploy, remove, none). |
| pages-base-url | What this Action thinks the base URL of the GitHub Pages site is. |
| preview-url-path | Path to the preview from the Pages base URL. |
| preview-url | Full URL to the preview (https://[pages-base-url]/[preview-url-path]/). |
| action-version | The version of this Action when it was run. |
| action-start-timestamp | The Unix timestamp that the action started. |
| action-start-time | The time that the action started in a readable format (UTC, depending on runner). |
| deployed-commit-sha | The commit SHA that was deployed to the preview branch. |
| deployment-url | Deprecated, use `preview-url` instead. |