From fbc3967fcb2daa42519a2e2dcfa350e675e0fdbc Mon Sep 17 00:00:00 2001 From: Eric Cabrel TIOGO Date: Sat, 22 Jun 2024 14:15:29 +0200 Subject: [PATCH] build: print branch name --- .github/workflows/deploy-migration.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-migration.yml b/.github/workflows/deploy-migration.yml index 380e3ff2..96548a08 100644 --- a/.github/workflows/deploy-migration.yml +++ b/.github/workflows/deploy-migration.yml @@ -1,8 +1,10 @@ -name: Build and release project +name: Deploy database migration on: pull_request: # TODO to be removed branches: - 'main' + paths: + - 'packages/domain/prisma/migrations/**' push: branches: - 'main' @@ -11,7 +13,7 @@ on: - 'packages/domain/prisma/migrations/**' jobs: - deploy-migration: + apply-migration: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -20,8 +22,14 @@ jobs: uses: planetscale/setup-pscale-action@v1 - name: Set database branch name + run: echo "PSCALE_BRANCH_NAME=$(echo ${{ github.head_ref }} | tr -cd '[:alnum:]-'| tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Apply migration env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} - run: echo "PSCALE_BRANCH_NAME=$(echo ${{ github.head_ref }} | tr -cd '[:alnum:]-'| tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + run: | + echo "$PSCALE_BRANCH_NAME" + echo "what is this" + echo "${{ env.PSCALE_BRANCH_NAME }}"