fix: update flux-diff workflow to use container
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 file changed
+35
-10
@@ -19,22 +19,47 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
path: ["kubernetes"]
|
paths: ["kubernetes"]
|
||||||
resource: ["helmrelease", "kustomization"]
|
resources: ["helmrelease", "kustomization"]
|
||||||
steps:
|
steps:
|
||||||
- name: Diff Resources
|
- name: Checkout Default Branch
|
||||||
uses: allenporter/flux-local/action/diff@4.2.1
|
uses: actions/checkout@v4
|
||||||
id: diff
|
|
||||||
with:
|
with:
|
||||||
sources: home-kubernetes
|
ref: "${{ github.event.repository.default_branch }}"
|
||||||
path: "${{ matrix.path }}"
|
path: default
|
||||||
resource: "${{ matrix.resource }}"
|
|
||||||
|
- name: Checkout Pull Request Branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: pull
|
||||||
|
|
||||||
|
- name: Diff Resources
|
||||||
|
uses: docker://ghcr.io/allenporter/flux-local:main
|
||||||
|
with:
|
||||||
|
args: >-
|
||||||
|
diff ${{ matrix.resources }}
|
||||||
|
--unified 6
|
||||||
|
--path-orig /github/workspace/default/${{ matrix.paths }}
|
||||||
|
--path /github/workspace/pull/${{ matrix.paths }}
|
||||||
|
--strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
|
||||||
|
--limit-bytes 10000
|
||||||
|
--all-namespaces
|
||||||
|
--sources "home-kubernetes"
|
||||||
|
--output-file diff.patch
|
||||||
|
|
||||||
|
- name: Generate Diff
|
||||||
|
id: diff
|
||||||
|
run: |
|
||||||
|
cat diff.patch
|
||||||
|
echo "diff<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
cat diff.patch >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- if: ${{ steps.diff.outputs.diff != '' }}
|
- if: ${{ steps.diff.outputs.diff != '' }}
|
||||||
name: Add comment
|
name: Add comment
|
||||||
uses: mshick/add-pr-comment@v2
|
uses: mshick/add-pr-comment@v2.8.1
|
||||||
with:
|
with:
|
||||||
message-id: "${{ github.event.pull_request.number }}/${{ matrix.path }}/${{ matrix.resource }}"
|
message-id: "${{ github.event.pull_request.number }}/${{ matrix.paths }}/${{ matrix.resources }}"
|
||||||
message-failure: Diff was not successful
|
message-failure: Diff was not successful
|
||||||
message: |
|
message: |
|
||||||
```diff
|
```diff
|
||||||
|
|||||||
Reference in new issue
Block a user