Skip to content

Commit

Permalink
feat: Add exceptions to GitHub output (#818)
Browse files Browse the repository at this point in the history
Signed-off-by: shayyxi <shazi12384@gmail.com>
Co-authored-by: shayyxi <shazi12384@gmail.com>
  • Loading branch information
shayyxi and shayyxi authored Apr 21, 2023
1 parent 6650c4c commit d578977
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Examples

This folder contains examples of how to use Conftest.

## How to test a manifest against a specific policy in the examples folder

There are various policies with the manifests in the examples folder. They can be tested in a following way:

Run the following command to build the local binary:
```console
make build
```

Then, run the following command to test the specific manifest against a specific policy:
```console
./conftest test -p examples/exceptions/policy/ examples/exceptions/deployments.yaml
```

In the above command, we are testing the manifest `examples/exceptions/deployments.yaml` against the policy `examples/exceptions/policy/`.

The `./conftest test` command supports various flags as well for different output formats and configurations. The list of
supported flags can be displayed with the following command:

```console
./conftest test --help
```
2 changes: 1 addition & 1 deletion output/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (t *GitHub) Output(checkResults []CheckResult) error {
}

for _, exception := range result.Exceptions {
fmt.Fprintf(t.writer, "exception file=%v %v\n", result.FileName, exception.Message)
fmt.Fprintf(t.writer, "::notice file=%v::%v\n", result.FileName, exception.Message)
}

for _, skipped := range result.Skipped {
Expand Down

0 comments on commit d578977

Please sign in to comment.