Skip to content

[main] Update Chart loki ( 5.43.7 → 5.44.1 ) #1432

[main] Update Chart loki ( 5.43.7 → 5.44.1 )

[main] Update Chart loki ( 5.43.7 → 5.44.1 ) #1432

Workflow file for this run

---
name: "Flux Diff"
on:
pull_request:
branches: ["main"]
paths: ["kubernetes/**"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
changed-files:
name: Changed Files
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
steps:
- name: Checkout Default Branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@77af4bed286740ef1a6387dc4e4e4dec39f96054 # v43
with:
files: kubernetes/**
dir_names: true
dir_names_max_depth: 2
json: true
quotepath: false
escape_json: false
- name: List All Changed Files
run: echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}"
flux-diff:
name: Flux Diff
runs-on: ubuntu-latest
needs: ["changed-files"]
permissions:
pull-requests: write
if: ${{ needs.changed-files.outputs.matrix != '[]' }}
strategy:
matrix:
paths: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
resources: ["helmrelease", "kustomization"]
steps:
- name: Generate Token
uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c # v1
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
token: "${{ steps.app-token.outputs.token }}"
path: pull
- name: Install Flux
uses: fluxcd/flux2/action@main
with:
version: "latest"
- name: Setup yq
uses: frenck/action-setup-yq@c4b5be8b4a215c536a41d436757d9feb92836d4f # v1
- name: Diff Resources
uses: allenporter/flux-local/action/diff@e630daec1a1bcd24dc80f5100c6e1c7b6a091153 # 4.3.1
id: diff
with:
sources: homelab-kubernetes
path: "${{ matrix.paths }}"
resource: "${{ matrix.resources }}"
- name: Add comment
if: ${{ steps.diff.outputs.diff != '' && github.event.pull_request.head.repo.full_name == github.repository }}
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
with:
repo-token: "${{ steps.app-token.outputs.token }}"
message-id: "${{ github.event.pull_request.number }}/${{ matrix.paths }}/${{ matrix.resources }}"
message-failure: Diff was not successful
message: |
```diff
${{ steps.diff.outputs.diff }}
```
flux-diff-success:
needs:
- flux-diff
if: ${{ always() }}
name: Flux Diff successful
runs-on: ubuntu-latest
steps:
- name: Check matrix status
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}
run: exit 1