Skip to content

Commit

Permalink
DOCKER_BUILD_NO_SUMMARY env to disable summary
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Jun 14, 2024
1 parent a29d7e9 commit 00f0c17
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ___
* [Customizing](#customizing)
* [inputs](#inputs)
* [outputs](#outputs)
* [environment variables](#environment-variables)
* [Subactions](#subactions)
* [`list-targets`](#list-targets)
* [Contributing](#contributing)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 00f0c17

Please sign in to comment.