Skip to content

Commit

Permalink
fix(ci): don't trigger workflow on pull request
Browse files Browse the repository at this point in the history
One of the few reasons to support pull_request events is to allow running the GitHub workflow on external pull requests.
That cannot work at the moment, because our GitHub repository URL is hardcoded in `requirements.txt`
  • Loading branch information
lucasmirloup committed Jul 5, 2024
1 parent 71ec067 commit 3980bd1
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
- "**"
tags:
- "v*"
pull_request:
branches:
- "master"

jobs:
Ansible:
Expand Down Expand Up @@ -47,11 +44,6 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract branch/tag name
id: extract_branch
shell: bash
run: echo "branch=$(echo ${GITHUB_REF/refs\/*\/})" >> $GITHUB_OUTPUT

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
Expand All @@ -60,8 +52,7 @@ jobs:
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
ANSIBLE_DEPLOY_BRANCH=${{ steps.extract_branch.outputs.branch }}
build-args: ANSIBLE_DEPLOY_BRANCH=${{ github.ref_name }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

Expand Down

0 comments on commit 3980bd1

Please sign in to comment.