Skip to content

Commit c646465

Browse files
committed
ci(deploy-docker): update workflow to check / fix permissions
check / fix permissions logic
1 parent f9b92cf commit c646465

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

.github/workflows/deploy-docker-dockerhub.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,23 @@ jobs:
162162
with:
163163
fetch-depth: 0
164164

165+
# #
166+
# Release › Tags › Check Permissions
167+
# #
168+
169+
- name: 'Check Permissions'
170+
run: |
171+
find ./ -name 'run' -exec chmod 755 {} \;
172+
WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print)
173+
if [ -n "${WRONG_PERM}" ]; then
174+
for i in ${WRONG_PERM}; do
175+
echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!"
176+
done
177+
exit 1
178+
else
179+
echo "**** Executable permissions are OK ****"
180+
fi
181+
165182
# #
166183
# Release › Tags › Create Tag
167184
#
@@ -213,6 +230,23 @@ jobs:
213230
with:
214231
fetch-depth: 0
215232

233+
# #
234+
# Release › Dockerhub › Check Permissions
235+
# #
236+
237+
- name: 'Check Permissions'
238+
run: |
239+
find ./ -name 'run' -exec chmod 755 {} \;
240+
WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print)
241+
if [ -n "${WRONG_PERM}" ]; then
242+
for i in ${WRONG_PERM}; do
243+
echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!"
244+
done
245+
exit 1
246+
else
247+
echo "**** Executable permissions are OK ****"
248+
fi
249+
216250
# #
217251
# Release › Dockerhub › QEMU › Arm64
218252
# #
@@ -336,6 +370,23 @@ jobs:
336370
with:
337371
fetch-depth: 0
338372

373+
# #
374+
# Release › Dockerhub › Check Permissions
375+
# #
376+
377+
- name: 'Check Permissions'
378+
run: |
379+
find ./ -name 'run' -exec chmod 755 {} \;
380+
WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print)
381+
if [ -n "${WRONG_PERM}" ]; then
382+
for i in ${WRONG_PERM}; do
383+
echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!"
384+
done
385+
exit 1
386+
else
387+
echo "**** Executable permissions are OK ****"
388+
fi
389+
339390
# #
340391
# Release › Dockerhub › QEMU › Amd64
341392
# #

.github/workflows/deploy-docker-github.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,23 @@ jobs:
162162
with:
163163
fetch-depth: 0
164164

165+
# #
166+
# Release › Tags › Check Permissions
167+
# #
168+
169+
- name: 'Check Permissions'
170+
run: |
171+
find ./ -name 'run' -exec chmod 755 {} \;
172+
WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print)
173+
if [ -n "${WRONG_PERM}" ]; then
174+
for i in ${WRONG_PERM}; do
175+
echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!"
176+
done
177+
exit 1
178+
else
179+
echo "**** Executable permissions are OK ****"
180+
fi
181+
165182
# #
166183
# Release › Tags › Create Tag
167184
#
@@ -213,6 +230,23 @@ jobs:
213230
with:
214231
fetch-depth: 0
215232

233+
# #
234+
# Release › Github › Check Permissions
235+
# #
236+
237+
- name: 'Check Permissions'
238+
run: |
239+
find ./ -name 'run' -exec chmod 755 {} \;
240+
WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print)
241+
if [ -n "${WRONG_PERM}" ]; then
242+
for i in ${WRONG_PERM}; do
243+
echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!"
244+
done
245+
exit 1
246+
else
247+
echo "**** Executable permissions are OK ****"
248+
fi
249+
216250
# #
217251
# Release › Github › QEMU › Arm64
218252
# #
@@ -333,6 +367,23 @@ jobs:
333367
with:
334368
fetch-depth: 0
335369

370+
# #
371+
# Release › Github › Check Permissions
372+
# #
373+
374+
- name: 'Check Permissions'
375+
run: |
376+
find ./ -name 'run' -exec chmod 755 {} \;
377+
WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print)
378+
if [ -n "${WRONG_PERM}" ]; then
379+
for i in ${WRONG_PERM}; do
380+
echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!"
381+
done
382+
exit 1
383+
else
384+
echo "**** Executable permissions are OK ****"
385+
fi
386+
336387
# #
337388
# Release › Github › QEMU › Amd64
338389
# #

0 commit comments

Comments
 (0)