This is an action to compute a diff between head and base, and post it to a comment.
To compute the diff between old-directory
and new-directory
:
- uses: int128/diff-action@v1
with:
base: old-directory
head: new-directory
If you use kustomize build
in your CI/CD pipeline, it would be useful if you can see the diff on a pull request.
To build manifests with int128/kustomize-action and show diff of it:
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
ref: main
path: main
- uses: int128/kustomize-action@v1
id: kustomize-head
with:
kustomization: config/default/kustomization.yaml
write-individual-files: true
- uses: int128/kustomize-action@v1
id: kustomize-base
with:
base-directory: main
kustomization: config/default/kustomization.yaml
write-individual-files: true
- uses: int128/diff-action@v1
with:
base: ${{ steps.kustomize-base.outputs.directory }}
head: ${{ steps.kustomize-head.outputs.directory }}
Here is an example.
To add label(s) if there is difference or remove it if not:
- uses: int128/diff-action@v1
with:
base: ${{ steps.kustomize-base.outputs.directory }}
head: ${{ steps.kustomize-head.outputs.directory }}
label: manifest-changed
This action posts a comment on pull request event only.
Name | Required | Description |
---|---|---|
base |
(required) | base path (multiline) |
head |
(required) | head path (multiline) |
label |
- | label(s) to add/remove to indicate diff (multiline) |
comment-header |
- | header of a comment to post |
comment-footer |
- | footer of a comment to post |
token |
github.token |
GitHub token to post a comment |
Name | Description |
---|---|
different |
true if there is any difference, or false |