From 9b139ed447668f2b2cfc4e7d0a87285348c56f1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Oct 2026 01:11:17 +0000 Subject: [PATCH 1/2] chore(deps): bump the github-actions group across 1 directory with 6 updates Bumps the github-actions group with 6 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github/codeql-action/init](https://github.com/github/codeql-action) | `4.37.9` | `4.39.1` | | [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.37.9` | `4.39.1` | | [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `4.3.0` | `4.4.0` | | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.3.0` | `4.4.1` | | [docker/login-action](https://github.com/docker/login-action) | `4.6.0` | `4.7.0` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `7.3.0` | `7.4.0` | Updates `github/codeql-action/init` from 4.37.9 to 4.39.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/cdf488f595d80d6e07e03d4674febd5ab45fa938...9b3254085494b55a0f7c4c2b3d2d52cc712ce370) Updates `github/codeql-action/analyze` from 4.37.9 to 4.39.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/cdf488f595d80d6e07e03d4674febd5ab45fa938...9b3254085494b55a0f7c4c2b3d2d52cc712ce370) Updates `docker/setup-qemu-action` from 4.3.0 to 4.4.0 - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/1f40c72289eff860ee54a304f1438e3cff362e0a...99012661954931238ded8c8b007157a8430204e1) Updates `docker/setup-buildx-action` from 4.3.0 to 4.4.1 - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/37fe631027851001ddb9b187196cc803df7f5f0e...f87e5991a6d7451dcb8d9637bfbc97413f497069) Updates `docker/login-action` from 4.6.0 to 4.7.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/dbcb813823bdd20940b903addbd779551569679f...81c6f93d4bc991e510b342a00b419b3bb4efc5c6) Updates `docker/build-push-action` from 7.3.0 to 7.4.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/53b7df96c91f9c12dcc8a07bcb9ccacbed38856a...c3c9e263c25d99ce0380d002d59b67737d91b0dc) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.39.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: github/codeql-action/analyze dependency-version: 4.39.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/setup-qemu-action dependency-version: 4.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/setup-buildx-action dependency-version: 4.4.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/login-action dependency-version: 4.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/build-push-action dependency-version: 7.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/docker.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0964b4db7..c406a7cef 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -40,11 +40,11 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4 - name: Initialize CodeQL - uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v3 + uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v3 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v3 + uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v3 with: category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b62964d68..3bd15e2b5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -99,13 +99,13 @@ jobs: # Docker Setup #--------------------------------------------------------------# - name: Set up QEMU - uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0 + uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0 + uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - name: Login to Docker Hub - uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 + uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -136,7 +136,7 @@ jobs: # Build and Push #--------------------------------------------------------------# - name: Build and push Docker image - uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 + uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 with: context: ./docker file: ./docker/Dockerfile From 2f0470807870925bf0198808ba52f0d151fde571 Mon Sep 17 00:00:00 2001 From: Feng Ruohang Date: Tue, 3 Nov 2026 20:20:13 +0800 Subject: [PATCH 2/2] ci: validate Docker builds on pull requests --- .github/workflows/codeql.yml | 4 +-- .github/workflows/docker.yml | 66 ++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c406a7cef..a7a279372 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -40,11 +40,11 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4 - name: Initialize CodeQL - uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v3 + uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v3 + uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 with: category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3bd15e2b5..379666b08 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,7 +11,8 @@ # and pushes them to Docker Hub under pgsty/pigsty. # # Trigger: -# - Manual trigger via workflow_dispatch only +# - Pull requests validate the image on amd64 and arm64 without publishing +# - Manual workflow_dispatch publishes a release tag # # Required secrets: # - DOCKERHUB_USERNAME: Docker Hub username @@ -25,9 +26,14 @@ name: Publish Docker Image -run-name: Publish Docker Image ${{ inputs.version }} +run-name: "Docker Image ${{ inputs.version || format('PR #{0}', github.event.pull_request.number) }}" on: + pull_request: + branches: [main] + paths: + - 'docker/**' + - '.github/workflows/docker.yml' workflow_dispatch: inputs: version: @@ -50,12 +56,13 @@ env: permissions: read-all concurrency: - group: docker-publish-${{ inputs.version }} + group: docker-${{ github.event_name }}-${{ github.event.pull_request.number || inputs.version }} cancel-in-progress: false jobs: build-and-push: runs-on: ubuntu-latest + timeout-minutes: 45 permissions: contents: read @@ -65,7 +72,7 @@ jobs: #--------------------------------------------------------------# - name: Validate version tag env: - VERSION: ${{ inputs.version }} + VERSION: ${{ inputs.version || 'v4.5.0' }} run: | if [[ ! "${VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z]+([.-][0-9A-Za-z]+)*)?$ ]]; then echo "Invalid version tag: ${VERSION}" >&2 @@ -77,19 +84,21 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4 with: fetch-depth: 0 - ref: ${{ inputs.version }} + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.sha }} - name: Extract version from input id: version env: - VERSION: ${{ inputs.version }} - PUSH_LATEST: ${{ inputs.push_latest }} + VERSION: ${{ inputs.version || 'v4.5.0' }} + PUSH_LATEST: ${{ inputs.push_latest || 'false' }} run: | VERSION_NUM="${VERSION#v}" - echo "version=${VERSION}" >> "${GITHUB_OUTPUT}" - echo "version_num=${VERSION_NUM}" >> "${GITHUB_OUTPUT}" - echo "push_latest=${PUSH_LATEST}" >> "${GITHUB_OUTPUT}" + { + echo "version=${VERSION}" + echo "version_num=${VERSION_NUM}" + echo "push_latest=${PUSH_LATEST}" + } >> "${GITHUB_OUTPUT}" echo "Version: ${VERSION}" echo "Version Number: ${VERSION_NUM}" @@ -105,6 +114,7 @@ jobs: uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - name: Login to Docker Hub + if: github.event_name == 'workflow_dispatch' uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -135,13 +145,13 @@ jobs: #--------------------------------------------------------------# # Build and Push #--------------------------------------------------------------# - - name: Build and push Docker image + - name: Build Docker image uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 with: context: ./docker file: ./docker/Dockerfile platforms: linux/amd64,linux/arm64 - push: true + push: ${{ github.event_name == 'workflow_dispatch' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | @@ -154,23 +164,27 @@ jobs: # Verification #--------------------------------------------------------------# - name: Inspect image + if: github.event_name == 'workflow_dispatch' run: | echo "Inspecting pushed images..." docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} - name: Summary + if: github.event_name == 'workflow_dispatch' run: | - echo "## Docker Image Published" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Images:**" >> $GITHUB_STEP_SUMMARY - echo "- \`${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY - if [ "${{ steps.version.outputs.push_latest }}" = "true" ]; then - echo "- \`${{ env.IMAGE_NAME }}:latest\`" >> $GITHUB_STEP_SUMMARY - fi - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Platforms:** linux/amd64, linux/arm64" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Pull command:**" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY - echo "docker pull ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + { + echo "## Docker Image Published" + echo "" + echo "**Images:**" + echo "- \`${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}\`" + if [ "${{ steps.version.outputs.push_latest }}" = "true" ]; then + echo "- \`${{ env.IMAGE_NAME }}:latest\`" + fi + echo "" + echo "**Platforms:** linux/amd64, linux/arm64" + echo "" + echo "**Pull command:**" + echo "\`\`\`bash" + echo "docker pull ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}" + echo "\`\`\`" + } >> "$GITHUB_STEP_SUMMARY"