This action queries the Tugboat API and get the ID of a preview associated with a given PR.
Note: This action may behave unexpectedly if there are more than one previews associated with a single pull request.
Required The Tugboat API token.
Required The Tugboat repository ID.
Required The GitHub pull request number.
The Tugboat preview ID.
jobs:
rebuild-tugboat-preview:
runs-on: ubuntu-latest
container:
image: tugboatqa/cli
steps:
- name: Get the ID of the Tugboat preview associated with this pull request
id: get-tugboat-preview-id
uses: chromatichq/tugboat-pull-request-preview-id@v1
with:
tugboat-api-token: ${{ secrets.TUGBOAT_API_TOKEN }}
tugboat-repo-id: ${{ secrets.TUGBOAT_REPO }}
pull-request-number: ${{ github.event.issue.number }}
# Use the output from the `get-tugboat-preview-id` step
- name: Rebuild Tugboat preview
run: tugboat rebuild ${{ steps.get-tugboat-preview-id.outputs.tugboat-preview-id }}"
To build this image locally on Apple Silicon, use the following command.
docker buildx build --platform linux/amd64 -t "tugboat_pr_action:Dockerfile" .
docker run -it tugboat_pr_action:Dockerfile <REPLACE_WITH_TUGBOAT_TOKEN> <REPLACE_WITH_TUGBOAT_REPO_ID> <REPLACE WITH PR ID>