Skip to content

Commit eb0e46e

Browse files
authored
Merge pull request #229 from crazy-max/build-summary-env-change
switch DOCKER_BUILD_SUMMARY_DISABLE to DOCKER_BUILD_SUMMARY
2 parents c0fe07d + e14760b commit eb0e46e

File tree

5 files changed

+38
-15
lines changed

5 files changed

+38
-15
lines changed

.github/workflows/ci.yml

+24-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,30 @@ jobs:
544544
./test/config.hcl
545545
targets: app
546546
env:
547-
DOCKER_BUILD_SUMMARY_DISABLE: true
547+
DOCKER_BUILD_SUMMARY: false
548+
549+
summary-disable-deprecated:
550+
runs-on: ubuntu-latest
551+
steps:
552+
-
553+
name: Checkout
554+
uses: actions/checkout@v4
555+
-
556+
name: Set up Docker Buildx
557+
uses: docker/setup-buildx-action@v3
558+
with:
559+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
560+
driver-opts: |
561+
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
562+
-
563+
name: Build
564+
uses: ./
565+
with:
566+
files: |
567+
./test/config.hcl
568+
targets: app
569+
env:
570+
DOCKER_BUILD_NO_SUMMARY: true
548571

549572
summary-not-supported:
550573
runs-on: ubuntu-latest

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ including build stats, logs, outputs, and more. The build record can be
154154
imported to Docker Desktop for inspecting the build in greater detail.
155155

156156
Summaries are enabled by default, but can be disabled with the
157-
`DOCKER_BUILD_NO_SUMMARY` [environment variable](#environment-variables).
157+
`DOCKER_BUILD_SUMMARY` [environment variable](#environment-variables).
158158

159159
For more information about summaries, refer to the
160160
[documentation](https://docs.docker.com/go/build-summary/).
@@ -279,10 +279,10 @@ The following outputs are available
279279

280280
### environment variables
281281

282-
| Name | Type | Description |
283-
|--------------------------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
284-
| `DOCKER_BUILD_SUMMARY_DISABLE` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
285-
| `DOCKER_BUILD_EXPORT_RETENTION_DAYS` | Number | Duration after which build export artifact will expire in days. Defaults to repository/org [retention settings](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy) if unset or `0` |
282+
| Name | Type | Default | Description |
283+
|--------------------------------------|--------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
284+
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
285+
| `DOCKER_BUILD_EXPORT_RETENTION_DAYS` | Number | | Duration after which build export artifact will expire in days. Defaults to repository/org [retention settings](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy) if unset or `0` |
286286

287287
## Contributing
288288

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ actionsToolkit.run(
164164
});
165165

166166
await core.group(`Check build summary support`, async () => {
167-
if (buildSummaryDisabled()) {
167+
if (!buildSummaryEnabled()) {
168168
core.info('Build summary disabled');
169169
} else if (GitHub.isGHES) {
170170
core.warning('Build summary is not yet supported on GHES');
@@ -244,14 +244,14 @@ async function buildRefs(toolkit: Toolkit, since: Date, builder?: string): Promi
244244
return refs;
245245
}
246246

247-
function buildSummaryDisabled(): boolean {
247+
function buildSummaryEnabled(): boolean {
248248
if (process.env.DOCKER_BUILD_NO_SUMMARY) {
249-
core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Use DOCKER_BUILD_SUMMARY_DISABLE instead.');
250-
return Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
251-
} else if (process.env.DOCKER_BUILD_SUMMARY_DISABLE) {
252-
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY_DISABLE);
249+
core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Set DOCKER_BUILD_SUMMARY to false instead.');
250+
return !Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
251+
} else if (process.env.DOCKER_BUILD_SUMMARY) {
252+
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY);
253253
}
254-
return false;
254+
return true;
255255
}
256256

257257
function buildExportRetentionDays(): number | undefined {

0 commit comments

Comments
 (0)