From 611f4b53721ae8f7a136acd07741033fbd54e560 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 20 Aug 2020 23:21:55 -0400 Subject: [PATCH 1/2] chore: Add check for missing Alpine CHECKSUM --- .github/workflows/missing-checksum.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/missing-checksum.yml diff --git a/.github/workflows/missing-checksum.yml b/.github/workflows/missing-checksum.yml new file mode 100644 index 000000000..fcc3af02f --- /dev/null +++ b/.github/workflows/missing-checksum.yml @@ -0,0 +1,22 @@ +name: Check Alpine CHECKSUM + +on: + pull_request: + paths: + - ".github/workflows/missing-checksum.yml" + - "**/alpine*/Dockerfile" + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Count number of Alpine Dockersfiles without CHECKSUM + run: | + if [ "$(find -path *alpine*/Dockerfile -exec grep -l CHECKSUM=\"\" {} \; | wc -l)" == 0 ]; then + exit 0 + else + # echo "::error file=FILENAME,line=15,col=22::Missing pre-built checksum" + exit 1 + fi From 73f32c4757b1bccc0411fe378a542e1d2dfb036d Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Tue, 12 Oct 2021 23:36:54 -0400 Subject: [PATCH 2/2] Update .github/workflows/missing-checksum.yml Co-authored-by: Mason Malone --- .github/workflows/missing-checksum.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/missing-checksum.yml b/.github/workflows/missing-checksum.yml index fcc3af02f..cbd870ccf 100644 --- a/.github/workflows/missing-checksum.yml +++ b/.github/workflows/missing-checksum.yml @@ -14,9 +14,7 @@ jobs: - name: Count number of Alpine Dockersfiles without CHECKSUM run: | - if [ "$(find -path *alpine*/Dockerfile -exec grep -l CHECKSUM=\"\" {} \; | wc -l)" == 0 ]; then - exit 0 - else - # echo "::error file=FILENAME,line=15,col=22::Missing pre-built checksum" - exit 1 + git grep -n 'CHECKSUM=""' -- '*alpine*/Dockerfile' | sed -E 's/^([^:]+):([^:]+):\s*/::error file=\1,line=\2::Missing pre-built checksum/' + if [ "${PIPESTATUS[0]}" -eq 0 ]; then + exit 1 fi