From 6e7da79dd42b1d6f98cfefb6e42e270cafc47614 Mon Sep 17 00:00:00 2001 From: aptalca Date: Mon, 12 Dec 2022 12:27:03 -0500 Subject: [PATCH 1/3] add permission check workflow --- .github/workflows/permissions.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/permissions.yml diff --git a/.github/workflows/permissions.yml b/.github/workflows/permissions.yml new file mode 100644 index 0000000..cfb610b --- /dev/null +++ b/.github/workflows/permissions.yml @@ -0,0 +1,26 @@ +name: Permission check + +on: + pull_request: + paths: + - '**/run' + - '**/finish' + +jobs: + permission_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.1.0 + with: + fetch-depth: '0' + + - name: Check Permissions + run: | + WRONG_PERM=$(find ./ -name run -not -perm -u=x,g=x,o=x && find ./ -name finish -not -perm -u=x,g=x,o=x) + if [ -n "${WRONG_PERM}" ]; then + echo "**** The following files are missing the executable bit: ****" + echo "${WRONG_PERM}" + exit 1 + else + echo "**** All perms look good ****" + fi From 01070c583cf216a7402a82f895895071da5afc6a Mon Sep 17 00:00:00 2001 From: aptalca Date: Mon, 12 Dec 2022 21:05:58 -0500 Subject: [PATCH 2/3] set proper workflow error message --- .github/workflows/permissions.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/permissions.yml b/.github/workflows/permissions.yml index cfb610b..721c43f 100644 --- a/.github/workflows/permissions.yml +++ b/.github/workflows/permissions.yml @@ -18,8 +18,9 @@ jobs: run: | WRONG_PERM=$(find ./ -name run -not -perm -u=x,g=x,o=x && find ./ -name finish -not -perm -u=x,g=x,o=x) if [ -n "${WRONG_PERM}" ]; then - echo "**** The following files are missing the executable bit: ****" - echo "${WRONG_PERM}" + for i in ${WRONG_PERM}; do + echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!" + done exit 1 else echo "**** All perms look good ****" From 3e8f97648ffe600c16b39cd9723c1370c6126b92 Mon Sep 17 00:00:00 2001 From: aptalca Date: Tue, 13 Dec 2022 12:06:41 -0500 Subject: [PATCH 3/3] switch to callable --- .github/workflows/permissions.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/permissions.yml b/.github/workflows/permissions.yml index 721c43f..2df6b61 100644 --- a/.github/workflows/permissions.yml +++ b/.github/workflows/permissions.yml @@ -1,27 +1,9 @@ name: Permission check - on: pull_request: paths: - '**/run' - '**/finish' - jobs: permission_check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.1.0 - with: - fetch-depth: '0' - - - name: Check Permissions - run: | - WRONG_PERM=$(find ./ -name run -not -perm -u=x,g=x,o=x && find ./ -name finish -not -perm -u=x,g=x,o=x) - if [ -n "${WRONG_PERM}" ]; then - for i in ${WRONG_PERM}; do - echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!" - done - exit 1 - else - echo "**** All perms look good ****" - fi + uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1