Skip to content

Commit

Permalink
build: github actions check annotations
Browse files Browse the repository at this point in the history
Signed-off-by: David Karlsson <[email protected]>
  • Loading branch information
dvdksn committed Aug 7, 2024
1 parent a0db066 commit 3183586
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions content/build/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ Build checks are useful for:

## Build with checks

Build checks are supported in Buildx version 0.15.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:
Build checks are supported in:

- Buildx version 0.15.0 and later
- [docker/build-push-action](https://github.com/docker/build-push-action) version 6.6.0 and later

Check failure on line 37 in content/build/checks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Docker' instead of 'docker'. Raw Output: {"message": "[Vale.Terms] Use 'Docker' instead of 'docker'.", "location": {"path": "content/build/checks.md", "range": {"start": {"line": 37, "column": 4}}}, "severity": "ERROR"}
- [docker/bake-action](https://github.com/docker/bake-action) version 5.6.0 and later

Check failure on line 38 in content/build/checks.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Docker' instead of 'docker'. Raw Output: {"message": "[Vale.Terms] Use 'Docker' instead of 'docker'.", "location": {"path": "content/build/checks.md", "range": {"start": {"line": 38, "column": 4}}}, "severity": "ERROR"}

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
$ docker build .
Expand All @@ -49,6 +55,23 @@ In this example, the build ran successfully, but a
[JSONArgsRecommended](/reference/build-checks/json-args-recommended/) warning
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/[email protected]
```
![GitHub Actions build check annotations](./images/gha-check-annotations.png)
### More verbose output
Check warnings for a regular `docker build` display a concise message
Expand Down
Binary file added content/build/images/gha-check-annotations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3183586

Please sign in to comment.