Skip to content

Commit 52d2cc4

Browse files
committed
push to registry only for push event, from trusted contributors
1 parent 71c705f commit 52d2cc4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/github-actions-push-image.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ on:
88
- '!.github/**/*.md'
99
- '!.github/workflows/**'
1010
- '!.env.example'
11+
pull_request:
12+
paths:
13+
- '**'
14+
- '!README.md'
15+
- '!.github/**/*.md'
16+
- '!.github/workflows/**'
17+
- '!.env.example'
1118

1219
env:
1320
REGISTRY: index.docker.io
@@ -16,6 +23,10 @@ env:
1623

1724
jobs:
1825
push_to_registry:
26+
if: >
27+
github.event_name == 'push' ||
28+
github.event.pull_request.head.repo.full_name == github.repository ||
29+
contains(split(${{ secrets.TRUSTED_CONTRIBUTORS }}, ','), github.event.pull_request.user.login)
1930
name: Push Docker image to Docker Hub
2031
runs-on: ubuntu-latest
2132
permissions:

0 commit comments

Comments
 (0)