mirror of
https://github.com/auricom/home-cluster.git
synced 2025-12-26 08:54:49 +01:00
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
---
|
|
name: Flux diff
|
|
|
|
on:
|
|
pull_request:
|
|
branches: ['*']
|
|
paths:
|
|
- kubernetes/apps/**.yaml
|
|
- kubernetes/flux/**.yaml
|
|
|
|
jobs:
|
|
flux-diff:
|
|
name: Flux diff
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
strategy:
|
|
matrix:
|
|
path: ["cluster"]
|
|
resource: ["helmrelease", "kustomization"]
|
|
steps:
|
|
- name: Generate token
|
|
uses: tibdex/github-app-token@v2
|
|
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/diff@3.2.0
|
|
id: diff
|
|
with:
|
|
sources: flux-system
|
|
path: "${{ matrix.path }}"
|
|
resource: "${{ matrix.resource }}"
|
|
|
|
- if: ${{ steps.diff.outputs.diff != '' }}
|
|
name: Add comment
|
|
uses: mshick/add-pr-comment@v2.8.1
|
|
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 }}
|
|
```
|