Skip to content

fix(docker-image): update ghcr.io/mmalyska/s3-bucket-cleaner docker tag to v2.18.7 #2063

fix(docker-image): update ghcr.io/mmalyska/s3-bucket-cleaner docker tag to v2.18.7

fix(docker-image): update ghcr.io/mmalyska/s3-bucket-cleaner docker tag to v2.18.7 #2063

---
name: Diff Releases on Pull Requests
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
paths:
- "cluster/**.yaml"
env:
conf_live_branch: main
conf_ignore_known_labels_containing_versions: true
# renovate: datasource=github-releases depName=siderolabs/kubelet
kube_version: v1.30.5
kube_api_versions: |
acme.cert-manager.io/v1
admissionregistration.k8s.io/v1
apiextensions.k8s.io/v1
apiregistration.k8s.io/v1
apps/v1
argoproj.io/v1alpha1
authentication.k8s.io/v1
authorization.k8s.io/v1
autoscaling/v1
autoscaling/v2
autoscaling/v2beta2
batch/v1
bitnami.com/v1alpha1
ceph.rook.io/v1
cert-manager.io/v1
certificates.k8s.io/v1
coordination.k8s.io/v1
deviceplugin.intel.com/v1
discovery.k8s.io/v1
events.k8s.io/v1
flowcontrol.apiserver.k8s.io/v1beta1
flowcontrol.apiserver.k8s.io/v1beta2
fpga.intel.com/v2
metallb.io/v1alpha1
metallb.io/v1beta1
metallb.io/v1beta2
metrics.k8s.io/v1beta1
monitoring.coreos.com/v1
monitoring.coreos.com/v1alpha1
networking.k8s.io/v1
nfd.k8s-sigs.io/v1alpha1
node.k8s.io/v1
objectbucket.io/v1alpha1
policy/v1
rbac.authorization.k8s.io/v1
scheduling.k8s.io/v1
storage.k8s.io/v1
storage.k8s.io/v1beta1
traefik.io/v1alpha1
v1
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
helm_files: ${{ steps.unified.outputs.helm_files }}
kustomize_files: ${{ steps.unified.outputs.kustomize_files }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: .github/workflow-scripts/file-filters.yml
- id: unified
run: |
.github/workflow-scripts/unify-diff-files.sh -t helm -f "${{ steps.filter.outputs.helm_files }}" -o helm_files
.github/workflow-scripts/unify-diff-files.sh -t kustomize -f "${{ steps.filter.outputs.kustomize_files }}" -o kustomize_files
helm-release-diff:
name: Helm releases differ
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.helm_files != '[]' && needs.changes.outputs.helm_files != '' }}
needs:
- changes
strategy:
matrix:
file: ${{ fromJson(needs.changes.outputs.helm_files) }}
fail-fast: false
steps:
- uses: mmalyska/action-setup-kube-tools@releases/v0.12.0
with:
setup-tools: |
helm
yq
# renovate: datasource=github-releases depName=helm/helm
helm: "3.16.2"
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
ref: ${{ env.conf_live_branch }}
path: live
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
path: pr
- id: diff
run: |
hr_live_path="live/${{ matrix.file }}"
hr_pr_path="pr/${{ matrix.file }}"
resources_live=$(helm template "$hr_live_path" --dependency-update --kube-version "$kube_version" --api-versions "$kube_api_versions" || true)
# echo "$resources_live"
# echo "#####################################################"
resources_pr=$(helm template "$hr_pr_path" --dependency-update --kube-version "$kube_version" --api-versions "$kube_api_versions" || true)
# echo "$resources_pr"
# echo "#####################################################"
if [ "$conf_ignore_known_labels_containing_versions" = "true" ]; then
labels='.metadata.labels."helm.sh/chart"'
labels+=',.metadata.labels.chart'
labels+=',.metadata.labels."app.kubernetes.io/version"'
labels+=',.spec.template.metadata.labels."helm.sh/chart"'
labels+=',.spec.template.metadata.labels.chart'
labels+=',.spec.template.metadata.labels."app.kubernetes.io/version"'
labels+=',.spec.template.metadata.annotations."checksum/*"'
resources_live=$(echo "$resources_live" | yq e "del($labels)" -)
resources_pr=$(echo "$resources_pr" | yq e "del($labels)" -)
fi
diff=$( (diff -u <(echo "$resources_live") <(echo "$resources_pr") || true) | tail +3)
# echo "$diff"
message="Path: \`${{ matrix.file }}\`"$'\n'$'\n'
if [ -z "$diff" ]; then
message="$message"'```'$'\n'"No changes detected in resources"$'\n''```'
else
message="$message"'```diff'$'\n'"$diff"$'\n''```'
fi
mkdir ${{ runner.temp }}/diff_items
if [ ${#message} -gt 10000 ]; then
diff_filename=$(echo "${{ matrix.file }}" | sed 's,/,_,g')
diff_no_changes=$( (diff -y --suppress-common-lines <(echo "$resources_live") <(echo "$resources_pr") || true) | wc -l)
echo "diff-filename=$diff_filename" >> "$GITHUB_OUTPUT"
echo -e "$message" > "${{ runner.temp }}/diff_items/$diff_filename.diff"
echo "Path: \`${{ matrix.file }}\`"$'\n'$'\n'"The message was too long. Diff contains \`$diff_no_changes\` changes. You can find it in artifacts of action https://github.com/mmalyska/home-ops/actions/runs/${{ github.run_id }}#artifacts" > ${{ runner.temp }}/diff_items/message.txt
else
echo "$message" > ${{ runner.temp }}/diff_items/message.txt
fi
- name: Add diff item
uses: actions/upload-artifact@v4
if: steps.diff.outputs.diff-filename
with:
name: helm_diff_files
path: ${{ runner.temp }}/diff_items/${{ steps.diff.outputs.diff-filename }}.diff
retention-days: 14
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "Path: `${{ matrix.file }}`"
- uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: ${{ runner.temp }}/diff_items/message.txt
edit-mode: replace
kustomize-release-diff:
name: Kustomize releases differ
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.kustomize_files != '[]' && needs.changes.outputs.kustomize_files != '' }}
needs:
- changes
strategy:
matrix:
file: ${{ fromJson(needs.changes.outputs.kustomize_files) }}
fail-fast: false
steps:
- uses: mmalyska/action-setup-kube-tools@releases/v0.12.0
with:
# renovate: datasource=github-releases depName=siderolabs/kubelet
kubectl: "v1.30.5"
setup-tools: |
kubectl
yq
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
ref: ${{ env.conf_live_branch }}
path: live
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
path: pr
- id: diff
run: |
k_live_path="live/${{ matrix.file }}"
k_pr_path="pr/${{ matrix.file }}"
resources_live=$(kubectl kustomize "$k_live_path" || true)
# echo "$resources_live"
# echo "#####################################################"
resources_pr=$(kubectl kustomize "$k_pr_path" || true)
# echo "$resources_pr"
# echo "#####################################################"
if [ "$conf_ignore_known_labels_containing_versions" = "true" ]; then
labels='.metadata.labels."app.kubernetes.io/version"'
labels+=',.spec.template.metadata.labels."app.kubernetes.io/version"'
labels+=',.spec.template.metadata.annotations."checksum/*"'
resources_live=$(echo "$resources_live" | yq e "del($labels)" -)
resources_pr=$(echo "$resources_pr" | yq e "del($labels)" -)
fi
diff=$( (diff -u <(echo "$resources_live") <(echo "$resources_pr") || true) | tail +3)
# echo "$diff"
message="Path: \`${{ matrix.file }}\`"$'\n'$'\n'
if [ -z "$diff" ]; then
message="$message"'```'$'\n'"No changes detected in resources"$'\n''```'
else
message="$message"'```diff'$'\n'"$diff"$'\n''```'
fi
mkdir ${{ runner.temp }}/diff_items
if [ ${#message} -gt 10000 ]; then
diff_filename=$(echo "${{ matrix.file }}" | sed 's,/,_,g')
diff_no_changes=$( (diff -y --suppress-common-lines <(echo "$resources_live") <(echo "$resources_pr") || true) | wc -l)
echo "diff-filename=$diff_filename" >> "$GITHUB_OUTPUT"
echo -e "$message" > "${{ runner.temp }}/diff_items/$diff_filename.diff"
echo "Path: \`${{ matrix.file }}\`"$'\n'$'\n'"The message was too long. Diff contains \`$diff_no_changes\` changes. You can find it in artifacts of action https://github.com/mmalyska/home-ops/actions/runs/${{ github.run_id }}#artifacts" > ${{ runner.temp }}/diff_items/message.txt
else
echo "$message" > ${{ runner.temp }}/diff_items/message.txt
fi
- name: Add diff item
uses: actions/upload-artifact@v4
if: steps.diff.outputs.diff-filename
with:
name: kustomize_diff_files
path: ${{ runner.temp }}/diff_items/${{ steps.diff.outputs.diff-filename }}.diff
retention-days: 14
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "Path: `${{ matrix.file }}`"
- uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: ${{ runner.temp }}/diff_items/message.txt
edit-mode: replace