build(deps): bump github.com/moby/buildkit from 0.23.1 to 0.28.1 in /tools/dockerfile-from-checker #369
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2024-2025, Zededa, Inc. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| --- | |
| name: Check Docker Hashes Consistency | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - "master" | |
| - "[0-9]+.[0-9]+" | |
| - "[0-9]+.[0-9]+-stable" | |
| - "feature/*" | |
| paths-ignore: | |
| - '**/*.md' | |
| - '.github/**' | |
| pull_request: | |
| branches: | |
| - "master" | |
| - "[0-9]+.[0-9]+" | |
| - "[0-9]+.[0-9]+-stable" | |
| - "feature/*" | |
| paths-ignore: | |
| - '**/*.md' | |
| - '.github/**' | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Cache Go modules | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ${{ github.workspace }}/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Build get-deps helper | |
| shell: bash | |
| run: | | |
| echo "::group::[Build] tools/get-deps (go mod download + build)" | |
| make -C ./tools/get-deps GOOS=linux | |
| echo "::endgroup::" | |
| - name: Build dockerfile-from-checker helper | |
| shell: bash | |
| run: | | |
| echo "::group::[Build] tools/dockerfile-from-checker" | |
| make -C ./tools/dockerfile-from-checker | |
| echo "::endgroup::" | |
| - name: Verify Dockerfile hash consistency | |
| shell: bash | |
| run: | | |
| echo "::group::[Check] pkg: compare Dockerfile hashes" | |
| set -e | |
| log_file=$(mktemp) | |
| make check-docker-hashes-consistency >"$log_file" 2>&1 || rc=$? | |
| rc=${rc:-0} # rc is non-empty only when make failed | |
| cat "$log_file" | |
| echo "::endgroup::" | |
| if [ "$rc" -ne 0 ]; then | |
| # Pattern 1: <file> uses <image:tag> but <hash> is built in this repo | |
| pat_uses='^[[:space:]]*([^[:space:]]+)[[:space:]]+uses[[:space:]].*is[[:space:]]+built[[:space:]]+in[[:space:]]+this[[:space:]]+repo[[:space:]]*$' | |
| # Pattern 2: tags differ for image ... in files <file1> and <file2> | |
| pat_tags='^[[:space:]]*tags[[:space:]]+differ[[:space:]]+for[[:space:]]+image[[:space:]]+.+[[:space:]]+in[[:space:]]+files[[:space:]]+([^[:space:]]+)[[:space:]]+and[[:space:]]+([^[:space:]]+)[[:space:]]*$' | |
| while IFS= read -r line; do | |
| if [[ $line =~ $pat_uses ]]; then | |
| echo "::error file=${BASH_REMATCH[1]}::${line}" | |
| continue | |
| fi | |
| if [[ $line =~ $pat_tags ]]; then | |
| echo "::error file=${BASH_REMATCH[1]}::${line}" | |
| echo "::error file=${BASH_REMATCH[2]}::${line}" | |
| continue | |
| fi | |
| done < "$log_file" | |
| exit 1 | |
| fi | |
| exit $rc |