diff --git a/.github/workflows/ansible-deploy.yml b/.github/workflows/ansible-deploy.yml index b6cd710..4968288 100644 --- a/.github/workflows/ansible-deploy.yml +++ b/.github/workflows/ansible-deploy.yml @@ -42,7 +42,9 @@ jobs: - name: Run Ansible Playbook run: | - if [ $GITHUB_REF == "refs/heads/dev" ]; then + # If PR reference base ref, else use current ref + REF="${{ github.event.workflow_run.base_ref || github.ref }}" + if [ $REF == *"dev" ]; then PLAYBOOK=dev.yml else PLAYBOOK=prod.yml