-
Notifications
You must be signed in to change notification settings - Fork 33
50 lines (45 loc) · 1.38 KB
/
flux-diff.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Flux Diff"
on:
pull_request:
branches:
- main
paths:
- "kubernetes/**/*.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
flux-diff:
name: Flux Diff
runs-on: ubuntu-latest
permissions:
pull-requests: write
strategy:
matrix:
resource:
- helmrelease
- kustomization
fail-fast: false
steps:
- name: Setup Flux CLI
uses: fluxcd/flux2/action@5350425cdcd5fa015337e09fa502153c0275bd4b # v2.4.0
- uses: allenporter/flux-local/action/diff@05de0c97eba82d7cdc4faa7279752e17e3c565cf # 7.0.0
id: diff
with:
live-branch: main
path: "kubernetes/clusters/cluster-0"
resource: ${{ matrix.resource }}
sources: "cluster=./kubernetes/"
- name: PR Comments
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2
if: ${{ steps.diff.outputs.diff != '' }}
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message-id: ${{ github.event.pull_request.number }}/${{ matrix.resource }}
message-failure: Diff was not successful
message: |
```diff
${{ steps.diff.outputs.diff }}
```