Skip to content

Commit bca5082

Browse files
authored
Merge pull request #1173 from crazy-max/build-summary-env-change
switch DOCKER_BUILD_SUMMARY_DISABLE to DOCKER_BUILD_SUMMARY
2 parents 53ec486 + e7aab40 commit bca5082

File tree

5 files changed

+38
-15
lines changed

5 files changed

+38
-15
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,30 @@ jobs:
13661366
with:
13671367
file: ./test/Dockerfile
13681368
env:
1369-
DOCKER_BUILD_SUMMARY_DISABLE: true
1369+
DOCKER_BUILD_SUMMARY: false
1370+
1371+
summary-disable-deprecated:
1372+
runs-on: ubuntu-latest
1373+
steps:
1374+
-
1375+
name: Checkout
1376+
uses: actions/checkout@v4
1377+
with:
1378+
path: action
1379+
-
1380+
name: Set up Docker Buildx
1381+
uses: docker/setup-buildx-action@v3
1382+
with:
1383+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
1384+
driver-opts: |
1385+
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
1386+
-
1387+
name: Build
1388+
uses: ./action
1389+
with:
1390+
file: ./test/Dockerfile
1391+
env:
1392+
DOCKER_BUILD_NO_SUMMARY: true
13701393

13711394
summary-not-supported:
13721395
runs-on: ubuntu-latest

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ more. The build record can be imported to Docker Desktop for inspecting the
186186
build in greater detail.
187187

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

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

257257
### environment variables
258258

259-
| Name | Type | Description |
260-
|--------------------------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
261-
| `DOCKER_BUILD_SUMMARY_DISABLE` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
262-
| `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` |
259+
| Name | Type | Default | Description |
260+
|--------------------------------------|--------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
261+
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
262+
| `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` |
263263

264264
## Troubleshooting
265265

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ actionsToolkit.run(
138138
});
139139

140140
await core.group(`Check build summary support`, async () => {
141-
if (buildSummaryDisabled()) {
141+
if (!buildSummaryEnabled()) {
142142
core.info('Build summary disabled');
143143
} else if (GitHub.isGHES) {
144144
core.warning('Build summary is not yet supported on GHES');
@@ -211,14 +211,14 @@ async function buildRef(toolkit: Toolkit, since: Date, builder?: string): Promis
211211
return Object.keys(refs).length > 0 ? Object.keys(refs)[0] : '';
212212
}
213213

214-
function buildSummaryDisabled(): boolean {
214+
function buildSummaryEnabled(): boolean {
215215
if (process.env.DOCKER_BUILD_NO_SUMMARY) {
216-
core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Use DOCKER_BUILD_SUMMARY_DISABLE instead.');
217-
return Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
218-
} else if (process.env.DOCKER_BUILD_SUMMARY_DISABLE) {
219-
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY_DISABLE);
216+
core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Set DOCKER_BUILD_SUMMARY to false instead.');
217+
return !Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
218+
} else if (process.env.DOCKER_BUILD_SUMMARY) {
219+
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY);
220220
}
221-
return false;
221+
return true;
222222
}
223223

224224
function buildExportRetentionDays(): number | undefined {

0 commit comments

Comments
 (0)