feat: add flux diff local action workflow
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 file changed
+38
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: "Flux Diff"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: ["main"]
|
||||||
|
paths: ["kubernetes/**.yaml"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
flux-diff:
|
||||||
|
name: Flux Diff
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
path: ["kubernetes"]
|
||||||
|
resource: ["helmrelease", "kustomization"]
|
||||||
|
steps:
|
||||||
|
- name: Diff Resources
|
||||||
|
uses: allenporter/flux-local/action/diff@efbe055c6dc2a63d1102db582632d2aa03696664 # 3.1.1
|
||||||
|
id: diff
|
||||||
|
with:
|
||||||
|
sources: home-kubernetes
|
||||||
|
path: "${{ matrix.path }}"
|
||||||
|
resource: "${{ matrix.resource }}"
|
||||||
|
|
||||||
|
- if: ${{ steps.diff.outputs.diff != '' }}
|
||||||
|
name: Add comment
|
||||||
|
uses: mshick/add-pr-comment@7c0890544fb33b0bdd2e59467fbacb62e028a096 # v2.8.1
|
||||||
|
with:
|
||||||
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
message-id: "${{ github.event.pull_request.number }}/${{ matrix.path }}/${{ matrix.resource }}"
|
||||||
|
message-failure: Diff was not successful
|
||||||
|
message: |
|
||||||
|
```diff
|
||||||
|
${{ steps.diff.outputs.diff }}
|
||||||
|
```
|
||||||
Reference in new issue
Block a user