From b874569f003937088070cb530c4bf38b6e956f3e Mon Sep 17 00:00:00 2001 From: jandroav Date: Fri, 5 Jan 2024 09:52:45 +0100 Subject: [PATCH] fix(generate.yml): add condition to deploy infrastructure and generate action jobs to only run on the main branch --- .github/workflows/generate.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 4cf7655..c9a00e1 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -65,6 +65,7 @@ jobs: run: spacectl stack local-preview --id liquibase-github-actions --disregard-gitignore=true - name: Deploy infrastructure + if: github.ref == 'refs/heads/main' env: SPACELIFT_API_KEY_ENDPOINT: ${{ secrets.SPACELIFT_API_KEY_ENDPOINT }} SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_API_KEY_ID }} @@ -74,6 +75,7 @@ jobs: generate-action: runs-on: ubuntu-latest needs: [ create-command-list, create-action-repo ] + if: github.ref == 'refs/heads/main' strategy: matrix: commands: ${{ fromJSON(needs.create-command-list.outputs.matrix) }}