Repository navigation
56 lines (53 loc) · 1.64 KB
/
Copy pathflux-diff.yaml
File metadata and controls
56 lines (53 loc) · 1.64 KB
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
51
52
53
54
55
56
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Flux Diff"
on:
pull_request:
branches: ["main"]
paths:
- infra/kubernetes/**/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
diffs:
name: Compute diffs
runs-on: ubuntu-latest
strategy:
matrix:
cluster_path:
- cluster-01
- cluster-02
resource:
- helmrelease
- kustomization
steps:
- name: Generate Token
uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout Pull Request Branch
uses: actions/checkout@v7
with:
token: "${{ steps.app-token.outputs.token }}"
- name: Setup Flux CLI
uses: fluxcd/flux2/action@v2.9.6
- uses: allenporter/flux-local/action/diff@8.4.0
id: diff
with:
live-branch: main
path: infra/kubernetes/${{ matrix.cluster_path }}/flux-system
resource: ${{ matrix.resource }}
- name: PR Comments
uses: mshick/add-pr-comment@v3
if: ${{ steps.diff.outputs.diff != '' }}
with:
repo-token: ${{ steps.app-token.outputs.token }}
message-id: ${{ github.event.pull_request.number }}/${{ matrix.cluster_path }}/${{ matrix.resource }}
message-failure: Unable to post kustomization diff
message: |
`````diff
${{ steps.diff.outputs.diff }}
`````