Merge pull request #20554 from dvdksn/gha-check-annotations

build: github actions check annotations
This commit is contained in:
CrazyMax 2024-08-08 17:10:28 +02:00 committed by GitHub
commit bedf993eba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 3 deletions

View File

@ -31,9 +31,15 @@ Build checks are useful for:
## Build with checks ## Build with checks
Build checks are supported in Buildx version 0.15.0 and later. Invoking a build Build checks are supported in:
runs the checks by default, and displays any violations in the build output.
For example, the following command both builds the image and runs the checks: - Buildx version 0.15.0 and later
- [docker/build-push-action](https://github.com/docker/build-push-action) version 6.6.0 and later
- [docker/bake-action](https://github.com/docker/bake-action) version 5.6.0 and later
Invoking a build runs the checks by default, and displays any violations in the
build output. For example, the following command both builds the image and runs
the checks:
```console ```console
$ docker build . $ docker build .
@ -49,6 +55,23 @@ In this example, the build ran successfully, but a
[JSONArgsRecommended](/reference/build-checks/json-args-recommended/) warning [JSONArgsRecommended](/reference/build-checks/json-args-recommended/) warning
was reported, because `CMD` instructions should use JSON array syntax. was reported, because `CMD` instructions should use JSON array syntax.
With the GitHub Actions, the checks display in the diff view of pull requests.
```yaml
name: Build and push Docker images
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Build and push
uses: docker/build-push-action@v6.6.0
```
![GitHub Actions build check annotations](./images/gha-check-annotations.png)
### More verbose output ### More verbose output
Check warnings for a regular `docker build` display a concise message Check warnings for a regular `docker build` display a concise message

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB