Check for Alloy Modules updates #14
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: Check for Alloy Modules updates | |
# yamllint disable-line rule:truthy | |
on: | |
workflow_dispatch: | |
schedule: | |
# Run once a day | |
- cron: '0 0 * * *' | |
pull_request: | |
paths: | |
- .github/workflows/check-for-alloy-modules-updates.yaml | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
check-for-alloy-modules-updates: | |
name: Check for Alloy Modules updates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
- name: Regenerate files | |
working-directory: charts/k8s-monitoring | |
run: | | |
touch vendir.yml | |
make vendir.lock.yml clean build | |
- name: Check for changes in generated files | |
id: check-for-changes | |
working-directory: charts/k8s-monitoring | |
run: | | |
if ! git diff --exit-code .; then | |
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 (SHA: ${{ steps.get-details.outputs.sha }})" | |
base: main | |
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" | |
committer: GitHub <[email protected]> | |
commit-message: "Update Alloy Modules to the latest version (SHA: ${{ steps.get-details.outputs.sha }})" | |
labels: dependencies | |
branch: chore/update-alloy-modules | |
delete-branch: true |