-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (44 loc) · 1.27 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
---
name: "Flux Diff"
on:
pull_request:
branches: ["main"]
paths:
- "cluster/core/**.yml"
- "cluster/apps/**.yml"
- "cluster/core/**.yaml"
- "cluster/apps/**.yaml"
jobs:
flux-diff:
name: Flux Diff
runs-on: ubuntu-latest
permissions:
pull-requests: write
strategy:
matrix:
path: ["cluster/flux"]
resource: ["helmrelease", "kustomization"]
steps:
- name: Generate Token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: "${{ secrets.BOT_APP_ID }}"
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Diff Resources
uses: allenporter/flux-local/action/[email protected]
id: diff
with:
path: "${{ matrix.path }}"
resource: "${{ matrix.resource }}"
- if: ${{ steps.diff.outputs.diff != '' }}
name: Add comment
uses: mshick/[email protected]
with:
repo-token: "${{ steps.generate-token.outputs.token }}"
message-id: "${{ github.event.pull_request.number }}/${{ matrix.path }}/${{ matrix.resource }}"
message-failure: Diff was not successful
message: |
```diff
${{ steps.diff.outputs.diff }}
```