This repository has been archived by the owner on May 5, 2024. It is now read-only.
feat(helm-chart)!: Update Helm release kube-prometheus-stack to 58.4.0 #3305
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "HelmRelease Diff" | |
on: | |
pull_request: | |
branches: ["main"] | |
paths: ["kubernetes/**/helmrelease.yaml"] | |
env: | |
BOT_USERNAME: Trux-Bot | |
KUBERNETES_DIR: kubernetes/ | |
jobs: | |
changed-files: | |
name: Detect File Changes | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Generate Token | |
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | |
id: generate-token | |
with: | |
app_id: "${{ secrets.TRUXNELL_APP_ID }}" | |
private_key: "${{ secrets.TRUXNELL_APP_PRIVATE_KEY }}" | |
- name: Checkout | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
token: "${{ steps.generate-token.outputs.token }}" | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # v42.1.0 | |
with: | |
json: true | |
files: | | |
kubernetes/**/helmrelease.yaml | |
- id: set-matrix | |
run: echo "matrix={\"file\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "${GITHUB_OUTPUT}" | |
diff: | |
name: Diff on Helm Releases | |
runs-on: ubuntu-latest | |
needs: [changed-files] | |
strategy: | |
matrix: ${{ fromJSON(needs.changed-files.outputs.matrix) }} | |
steps: | |
- name: Generate Token | |
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | |
id: generate-token | |
with: | |
app_id: "${{ secrets.TRUXNELL_APP_ID }}" | |
private_key: "${{ secrets.TRUXNELL_APP_PRIVATE_KEY }}" | |
- name: Checkout | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
token: "${{ steps.generate-token.outputs.token }}" | |
- name: Checkout default branch | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
token: "${{ steps.generate-token.outputs.token }}" | |
ref: "${{ github.event.repository.default_branch }}" | |
path: default | |
- name: Setup Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Setup Tools | |
run: | | |
brew install helm homeport/tap/dyff kustomize yq | |
- name: Diff | |
id: diff | |
run: | | |
diff=$(npx zx ./.github/scripts/helmReleaseDiff.mjs \ | |
--current-release "default/${{ matrix.file }}" \ | |
--incoming-release "${{ matrix.file }}" \ | |
--kubernetes-dir ${{ env.KUBERNETES_DIR }}) | |
echo "diff<<EOF" >> "${GITHUB_OUTPUT}" | |
echo "${diff}" >> "${GITHUB_OUTPUT}" | |
echo "EOF" >> "${GITHUB_OUTPUT}" | |
- name: Find Comment | |
if: ${{ always() && steps.diff.outputs.diff != '' }} | |
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0 | |
id: find-comment | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: ${{ env.BOT_USERNAME }} | |
body-includes: ${{ matrix.file }} | |
- name: Create or update comment | |
if: ${{ always() && steps.diff.outputs.diff != '' }} | |
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
comment-id: ${{ steps.find-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
Helm Release: `${{ matrix.file }}` | |
``` | |
${{ steps.diff.outputs.diff }} | |
``` | |
edit-mode: replace |