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
|
||||
strategy:
|
||||
matrix:
|
||||
path: ["kubernetes"]
|
||||
resource: ["helmrelease", "kustomization"]
|
||||
paths: ["kubernetes"]
|
||||
resources: ["helmrelease", "kustomization"]
|
||||
steps:
|
||||
- name: Diff Resources
|
||||
uses: allenporter/flux-local/action/diff@4.2.1
|
||||
id: diff
|
||||
- name: Checkout Default Branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
sources: home-kubernetes
|
||||
path: "${{ matrix.path }}"
|
||||
resource: "${{ matrix.resource }}"
|
||||
ref: "${{ github.event.repository.default_branch }}"
|
||||
path: default
|
||||
|
||||
- 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 != '' }}
|
||||
name: Add comment
|
||||
uses: mshick/add-pr-comment@v2
|
||||
uses: mshick/add-pr-comment@v2.8.1
|
||||
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: |
|
||||
```diff
|
||||
|
||||
Reference in new issue
Block a user