From d5ea0e70830d98b7e204a339dfd6aa1b01dd6e3c Mon Sep 17 00:00:00 2001 From: Dylan Anthony <43723790+dbanty@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:32:13 -0700 Subject: [PATCH] Improve deploy deploy requests GitHub Action If a PR is closed but not merge, you probably don't want to deploy a deploy request (usually). This adds a check to the sample config to make sure that PRs are merged. Also updates the example and parameter based on the latest [v4 readme](https://github.com/planetscale/deploy-deploy-request-action#readme). --- docs/devops/deploy-deploy-request-action.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/devops/deploy-deploy-request-action.md b/docs/devops/deploy-deploy-request-action.md index f47a0ba7..ea74f9ed 100644 --- a/docs/devops/deploy-deploy-request-action.md +++ b/docs/devops/deploy-deploy-request-action.md @@ -31,16 +31,16 @@ on: jobs: deploy_deploy_request: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Deploy a deploy request - uses: planetscale/deploy-deploy-request-action@v1 + uses: planetscale/deploy-deploy-request-action@v4 with: org_name: bmorrison-ps database_name: recipes_db - branch_name: dev env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} @@ -52,8 +52,8 @@ jobs: - `org_name` - The name of the PlanetScale organization. - `database_name` - The name of the database to create the branch on. -- `number` - The number of the deploy request. **Optional** +- `number` - The number of the deploy request to deploy. Defaults to the latest deploy request. - `wait` - If set to `true`, this action will wait for the deploy request to merge before exiting.