Skip to content

Commit 3a2087b

Browse files
Merge pull request #28 from Tecnativa/fix-ci-prs-from-forks
[FIX] Skip push on fork PRs
2 parents 4b63f77 + aa1a78c commit 3a2087b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ jobs:
6868
run: docker tag ${{ env.DOCKER_REPO }}:${{ matrix.pg_version }}-alpine ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }}
6969
# Push
7070
- name: Push Docker Image to Docker Hub
71-
if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (env.IS_PR || github.ref == 'refs/heads/master')
71+
if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (github.ref == 'refs/heads/master' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository))
7272
env:
7373
REGISTRY_HOST: docker.io
7474
REGISTRY_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
7575
REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }}
7676
run: ./hooks/push
7777
- name: Push Docker Image to GitHub Registry
78-
if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (env.IS_PR || github.ref == 'refs/heads/master')
78+
if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (github.ref == 'refs/heads/master' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository))
7979
env:
8080
REGISTRY_HOST: ghcr.io
8181
REGISTRY_TOKEN: ${{ secrets.BOT_TOKEN }}

0 commit comments

Comments
 (0)