File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 18
18
push_to_registry :
19
19
name : Push Docker image to Docker Hub
20
20
runs-on : ubuntu-latest
21
- env :
22
- TRUSTED_CONTRIBUTORS : ${{ secrets.TRUSTED_CONTRIBUTORS }}
23
- if : >
24
- github.event_name == 'push' ||
25
- contains(env.TRUSTED_CONTRIBUTORS, github.actor)
21
+
26
22
permissions :
27
23
packages : write
28
24
contents : read
32
28
- name : Check out the repo
33
29
uses : actions/checkout@v4
34
30
31
+ - name : Check if user is trusted
32
+ env :
33
+ TRUSTED_CONTRIBUTORS : ${{ secrets.TRUSTED_CONTRIBUTORS }}
34
+ run : |
35
+ IFS=',' read -ra USERS <<< "$TRUSTED_CONTRIBUTORS"
36
+ for user in "${USERS[@]}"; do
37
+ if [[ "${{ github.actor }}" == "${user// /}" ]]; then
38
+ echo "User ${{ github.actor }} is trusted"
39
+ exit 0
40
+ fi
41
+ done
42
+ echo "Error: User ${{ github.actor }} is not in trusted contributors list"
43
+ exit 1
44
+
35
45
- name : Log in to Docker Hub
36
46
uses : docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
37
47
with :
Original file line number Diff line number Diff line change 11
11
def print_logs (text ):
12
12
if show_errors_in_console :
13
13
print (text )
14
- # test comment. Action trigger
14
+ # test comment. Action trigger
You can’t perform that action at this time.
0 commit comments