Skip to content

Commit

Permalink
Merge pull request #227 from crazy-max/rename-summary-disable
Browse files Browse the repository at this point in the history
rename DOCKER_BUILD_NO_SUMMARY to DOCKER_BUILD_SUMMARY_DISABLE
  • Loading branch information
crazy-max authored Jul 2, 2024
2 parents 2b6f83c + 03ad189 commit 09e9b54
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ jobs:
./test/config.hcl
targets: app
env:
DOCKER_BUILD_NO_SUMMARY: true
DOCKER_BUILD_SUMMARY_DISABLE: true

summary-not-supported:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ The following outputs are available

| 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 |
| `DOCKER_BUILD_SUMMARY_DISABLE` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
| `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` |

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ actionsToolkit.run(
});

await core.group(`Check build summary support`, async () => {
if (process.env.DOCKER_BUILD_NO_SUMMARY && Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY)) {
if (buildSummaryDisabled()) {
core.info('Build summary disabled');
} else if (GitHub.isGHES) {
core.warning('Build summary is not yet supported on GHES');
Expand Down Expand Up @@ -244,6 +244,16 @@ async function buildRefs(toolkit: Toolkit, since: Date, builder?: string): Promi
return refs;
}

function buildSummaryDisabled(): boolean {
if (process.env.DOCKER_BUILD_NO_SUMMARY) {
core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Use DOCKER_BUILD_SUMMARY_DISABLE instead.');
return Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
} else if (process.env.DOCKER_BUILD_SUMMARY_DISABLE) {
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY_DISABLE);
}
return false;
}

function buildExportRetentionDays(): number | undefined {
if (process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS) {
const res = parseInt(process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS);
Expand Down

0 comments on commit 09e9b54

Please sign in to comment.