Skip to content

Commit

Permalink
change dockerhub push trigger conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
zostaw committed Dec 2, 2023
1 parent 7435c8e commit f2f0632
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/push_dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches:
- main
pull_request:
branches:
- main
types:
- closed

jobs:
tests:
Expand All @@ -22,6 +22,16 @@ jobs:
submodules: true
token: ${{ secrets.CI_TOKEN }}

- name: Check Branch
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
# Check if the pull request is from the main branch, other branches should not push to dockerhub
if [ "${{ github.event.pull_request.head.ref }}" != "main" ]; then
echo "Skipping workflow for pull request from a branch other than main."
exit 78
fi
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

Expand Down

0 comments on commit f2f0632

Please sign in to comment.