From 3a611a271fd1940c6ee1c3654581738f5cfebbff Mon Sep 17 00:00:00 2001 From: Pete Wall Date: Tue, 7 Jan 2025 13:13:11 -0600 Subject: [PATCH] Fix alloy modules checking action (#1058) Also fix some yaml lint issues Signed-off-by: Pete Wall --- .../check-for-alloy-modules-updates.yaml | 27 +++++++++++-------- charts/k8s-monitoring-v1/values.yaml | 2 +- .../docs/examples/auth/oauth2/README.md | 1 + .../docs/examples/auth/oauth2/values.yaml | 1 + 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-for-alloy-modules-updates.yaml b/.github/workflows/check-for-alloy-modules-updates.yaml index 54a1eed7c..2b1ddfdba 100644 --- a/.github/workflows/check-for-alloy-modules-updates.yaml +++ b/.github/workflows/check-for-alloy-modules-updates.yaml @@ -8,11 +8,11 @@ on: - cron: '0 0 * * *' pull_request: paths: - - '.github/workflows/check-for-dependency-updates.yaml' + - .github/workflows/check-for-alloy-modules-updates.yaml permissions: - contents: "write" - pull-requests: "write" + contents: write + pull-requests: write jobs: check-for-alloy-modules-updates: @@ -24,14 +24,12 @@ jobs: - name: Install Helm uses: azure/setup-helm@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Regenerate files working-directory: charts/k8s-monitoring run: | - rm -f vendir.lock.yml - make clean build + touch vendir.yml + make vendir.lock.yml clean build - name: Check for changes in generated files id: check-for-changes @@ -41,16 +39,23 @@ jobs: echo "changed=true" >> "${GITHUB_OUTPUT}" fi + - name: Get details + id: get-details + if: steps.check-for-changes.outputs.changed == 'true' + working-directory: charts/k8s-monitoring + run: | + echo "sha=$(yq '.directories[0].contents[0].git.sha' vendir.lock.yml)" >> "${GITHUB_OUTPUT}" + - name: Create pull request if: steps.check-for-changes.outputs.changed == 'true' uses: peter-evans/create-pull-request@v7 with: title: "[dependency] Update Alloy Modules" - body: "Update Alloy Modules to the latest version" + body: "Update Alloy Modules to the latest version (SHA: ${{ steps.get-details.outputs.sha }})" base: main author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" - committer: "GitHub " - commit-message: "Update Alloy Modules to the latest version" + committer: GitHub + commit-message: "Update Alloy Modules to the latest version (SHA: ${{ steps.get-details.outputs.sha }})" labels: dependencies - branch: chore/update-alloy-modules" + branch: chore/update-alloy-modules delete-branch: true diff --git a/charts/k8s-monitoring-v1/values.yaml b/charts/k8s-monitoring-v1/values.yaml index d1fbf91fa..0bb83863c 100644 --- a/charts/k8s-monitoring-v1/values.yaml +++ b/charts/k8s-monitoring-v1/values.yaml @@ -645,7 +645,7 @@ metrics: scrapeInterval: "" # -- The list of namespaces to include in autodiscovery. If empty, all namespaces are included. - # @section -- Metrics Job: Auto-Discovery + # @section -- Metrics Job: Auto-Discovery namespaces: [] # -- The list of namespaces to exclude from autodiscovery. diff --git a/charts/k8s-monitoring/docs/examples/auth/oauth2/README.md b/charts/k8s-monitoring/docs/examples/auth/oauth2/README.md index eaecc075e..de749163d 100644 --- a/charts/k8s-monitoring/docs/examples/auth/oauth2/README.md +++ b/charts/k8s-monitoring/docs/examples/auth/oauth2/README.md @@ -9,6 +9,7 @@ This example demonstrates how to use OAuth2 for authentication. ## Values ```yaml +--- cluster: name: oauth2-auth-example diff --git a/charts/k8s-monitoring/docs/examples/auth/oauth2/values.yaml b/charts/k8s-monitoring/docs/examples/auth/oauth2/values.yaml index 5ded956af..f3b1968ec 100644 --- a/charts/k8s-monitoring/docs/examples/auth/oauth2/values.yaml +++ b/charts/k8s-monitoring/docs/examples/auth/oauth2/values.yaml @@ -1,3 +1,4 @@ +--- cluster: name: oauth2-auth-example