From 00f0c171f7b0bb43027b8bb9408996c94e2f84a2 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 15 May 2024 09:42:30 +0200 Subject: [PATCH] DOCKER_BUILD_NO_SUMMARY env to disable summary Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ README.md | 7 +++++++ src/main.ts | 4 ++++ 3 files changed, 35 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83109df..33d3e26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -522,3 +522,27 @@ jobs: name: Check docker run: | docker image inspect localhost:5000/name/app:latest + + disable-summary: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: ${{ inputs.buildx-version || env.BUILDX_VERSION }} + driver-opts: | + image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }} + network=host + - + name: Build + uses: ./ + with: + files: | + ./test/config.hcl + targets: app + env: + DOCKER_BUILD_NO_SUMMARY: true diff --git a/README.md b/README.md index b935b9a..5373fd5 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ ___ * [Customizing](#customizing) * [inputs](#inputs) * [outputs](#outputs) + * [environment variables](#environment-variables) * [Subactions](#subactions) * [`list-targets`](#list-targets) * [Contributing](#contributing) @@ -255,6 +256,12 @@ The following outputs are available |------------|----------|----------------------------| | `targets` | List/CSV | List of extracted targest | +### environment variables + +| Name | Type | Description | +|---------------------------|------|-------------------------------------------------------------------------------------------------------------------| +| `DOCKER_BUILD_NO_SUMMARY` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled | + ## Contributing Want to contribute? Awesome! You can find information about contributing to diff --git a/src/main.ts b/src/main.ts index 934affa..fb46346 100644 --- a/src/main.ts +++ b/src/main.ts @@ -166,6 +166,10 @@ actionsToolkit.run( async () => { if (stateHelper.buildRefs.length > 0) { await core.group(`Generating build summary`, async () => { + if (process.env.DOCKER_BUILD_NO_SUMMARY && Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY)) { + core.info('Summary disabled'); + return; + } try { const buildxHistory = new BuildxHistory(); const exportRes = await buildxHistory.export({