-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.21 KB
/
flux-differ.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
---
name: Flux differ
on:
pull_request:
branches: ['*']
paths: ['cluster/**.yaml']
jobs:
flux-differ:
name: Flux differ
runs-on: ubuntu-latest
permissions:
pull-requests: write
strategy:
matrix:
path: ["cluster"]
resource: ["helmrelease", "kustomization"]
steps:
- name: Generate token
uses: actions/create-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:
sources: flux-system
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 }}
```