From 2b542b23764be5a3e040bdc574b2898dda22ef5f Mon Sep 17 00:00:00 2001 From: Wayne Goosen <13494899+WayneGoosen@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:10:30 +0200 Subject: [PATCH] Add conditional job and trigger for pull requests --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 079d236..9223951 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,8 @@ on: # Using a different branch name? Replace `main` with your branch’s name push: branches: [ main ] + pull_request: + branches: [ main ] # Allows you to run this workflow manually from the Actions tab on GitHub. workflow_dispatch: @@ -28,6 +30,7 @@ jobs: package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: build runs-on: ubuntu-latest environment: