From 2e806f0d31337cb030d5430aacea7cda268d0e63 Mon Sep 17 00:00:00 2001 From: Eric Cabrel TIOGO Date: Sun, 23 Jun 2024 02:10:39 +0200 Subject: [PATCH] build(database): target the pr branch when applying migrations --- .github/workflows/migration-db-deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/migration-db-deploy.yml b/.github/workflows/migration-db-deploy.yml index 65c9c22e..adf0072a 100644 --- a/.github/workflows/migration-db-deploy.yml +++ b/.github/workflows/migration-db-deploy.yml @@ -20,7 +20,9 @@ jobs: uses: planetscale/setup-pscale-action@v1 - name: Set database branch name - run: echo "PSCALE_BRANCH_NAME=$(echo ${{ github.ref_name }} | tr -cd '[:alnum:]-'| tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + run: | + echo "${{ github.event.pull_request.base.ref }}" + echo "PSCALE_BRANCH_NAME=$(echo ${{ github.event.pull_request.base.ref }} | tr -cd '[:alnum:]-'| tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - name: Get the deploy request number in development branch run: |