Merge pull request #1173 from crazy-max/build-summary-env-change

switch DOCKER_BUILD_SUMMARY_DISABLE to DOCKER_BUILD_SUMMARY
This commit is contained in:
CrazyMax 2024-07-02 17:59:43 +02:00 коммит произвёл GitHub
Родитель 53ec48606f e7aab408d9
Коммит bca5082da7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 38 добавлений и 15 удалений

25
.github/workflows/ci.yml поставляемый
Просмотреть файл

@ -1366,7 +1366,30 @@ jobs:
with:
file: ./test/Dockerfile
env:
DOCKER_BUILD_SUMMARY_DISABLE: true
DOCKER_BUILD_SUMMARY: false
summary-disable-deprecated:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: action
-
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 }}
-
name: Build
uses: ./action
with:
file: ./test/Dockerfile
env:
DOCKER_BUILD_NO_SUMMARY: true
summary-not-supported:
runs-on: ubuntu-latest

Просмотреть файл

@ -186,7 +186,7 @@ more. The build record can be imported to Docker Desktop for inspecting the
build in greater detail.
Summaries are enabled by default, but can be disabled with the
`DOCKER_BUILD_NO_SUMMARY` [environment variable](#environment-variables).
`DOCKER_BUILD_SUMMARY` [environment variable](#environment-variables).
For more information about summaries, refer to the
[documentation](https://docs.docker.com/go/build-summary/).
@ -256,10 +256,10 @@ The following outputs are available:
### environment variables
| Name | Type | Description |
|--------------------------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `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` |
| Name | Type | Default | Description |
|--------------------------------------|--------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [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` |
## Troubleshooting

2
dist/index.js сгенерированный поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

2
dist/index.js.map сгенерированный поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -138,7 +138,7 @@ actionsToolkit.run(
});
await core.group(`Check build summary support`, async () => {
if (buildSummaryDisabled()) {
if (!buildSummaryEnabled()) {
core.info('Build summary disabled');
} else if (GitHub.isGHES) {
core.warning('Build summary is not yet supported on GHES');
@ -211,14 +211,14 @@ async function buildRef(toolkit: Toolkit, since: Date, builder?: string): Promis
return Object.keys(refs).length > 0 ? Object.keys(refs)[0] : '';
}
function buildSummaryDisabled(): boolean {
function buildSummaryEnabled(): 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);
core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Set DOCKER_BUILD_SUMMARY to false instead.');
return !Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
} else if (process.env.DOCKER_BUILD_SUMMARY) {
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY);
}
return false;
return true;
}
function buildExportRetentionDays(): number | undefined {