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 47e1aee
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 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 @@ -61,7 +53,7 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
ANSIBLE_DEPLOY_BRANCH=${{ steps.extract_branch.outputs.branch }}
ANSIBLE_DEPLOY_BRANCH="${{ github.ref_name }}"
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

Expand Down

0 comments on commit 47e1aee

Please sign in to comment.