Skip to content

Commit

Permalink
Make a regular action to check for alloy modules updates (#1055)
Browse files Browse the repository at this point in the history
* Make a regular action to check for alloy modules updates

Signed-off-by: Pete Wall <[email protected]>

* Fix workflow

Signed-off-by: Pete Wall <[email protected]>

---------

Signed-off-by: Pete Wall <[email protected]>
  • Loading branch information
petewall authored Jan 6, 2025
1 parent 34ec9dd commit 03b36c1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/check-for-alloy-modules-updates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
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-dependency-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
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Regenerate files
working-directory: charts/k8s-monitoring
run: |
rm -f vendir.lock.yml
make 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: 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"
base: main
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
committer: "GitHub <[email protected]>"
commit-message: "Update Alloy Modules to the latest version"
labels: dependencies
branch: chore/update-alloy-modules"
delete-branch: true
7 changes: 7 additions & 0 deletions charts/k8s-monitoring/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ templates/destinations/_destination_types.tpl: $(DESTINATION_VALUES_FILES)
done
echo '{{- end -}}' >> $@

vendir.lock.yml: vendir.yml
ifdef HAS_VENDIR
vendir sync
else
docker run --rm --volume $(shell pwd):/src --workdir /src ghcr.io/carvel-dev/docker-image:latest vendir sync
endif

alloyModules/LICENSE: vendir.yml vendir.lock.yml
ifdef HAS_VENDIR
vendir sync -l
Expand Down

0 comments on commit 03b36c1

Please sign in to comment.