Skip to content

Commit

Permalink
chore: Added updatecli support
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehipwell committed Jul 12, 2024
1 parent b32fb86 commit 7f5de39
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/check-updates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check Updates

on:
workflow_dispatch:
schedule:
- cron: 0 0 * * *

permissions:
contents: write
pull-requests: write

jobs:
check:
name: Check for updates
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0

- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@e5e6863d954b7495848bb43d693704934439d678 # v2.32.0

- name: Install Helm Docs
if: ${{ inputs.helm_docs && steps.changes.outputs.changed == 'true' }}
uses: action-stars/install-tool-from-github-release@58e2dd20166c0eb19ab9ac4d0966c930a647ee69 # v0.2.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
owner: norwoodj
repository: helm-docs
arch_amd64: x86_64
os_linux: Linux
check_command: helm-docs --version
version: latest

- name: Run Updatecli diff
run: updatecli diff --config ./updatecli/updatecli.d

- name: Run Updatecli apply
run: updatecli apply --config ./updatecli/updatecli.d
7 changes: 7 additions & 0 deletions updatecli/gh-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
github:
owner: '{{ requiredEnv "GITHUB_REPOSITORY_OWNER" }}'
repository: '{{ requiredEnv "GITHUB_REPOSITORY_OWNER" | splitList "/" | last }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
email: '{{ requiredEnv "GITHUB_ACTOR" }}@users.noreply.github.com'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
7 changes: 7 additions & 0 deletions updatecli/local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
github:
owner: stevehipwell
repository: helm-charts
user: stevehipwell
email: [email protected]
username: stevehipwell
token:
72 changes: 72 additions & 0 deletions updatecli/updatecli.d/fluent-bit-aggregator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Update `fluent-bit-aggregator` Helm chart

scms:
default:
kind: "github"
spec:
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
user: "{{ .github.user }}"
email: "{{ .github.email }}"
username: "{{ .github.username }}"
token: "{{ .github.token }}"
branch: main
commitmessage:
type: feat
scope: fluent-bit-aggregator

sources:
fluentBitRelease:
kind: githubrelease
spec:
owner: fluent
repository: fluent-bit
username: "{{ .github.username }}"
token: "{{ .github.token }}"
versionfilter:
kind: latest

conditions:
image:
name: OCI image available
kind: dockerimage
sourceid: fluentBitRelease
transformers:
- trimprefix: v
spec:
image: cr.fluentbit.io/fluent/fluent-bit
architectures: ["amd64", "arm64"]

targets:
appVersion:
name: Update chart app version
kind: helmchart
sourceid: fluentBitRelease
transformers:
- trimprefix: v
spec:
name: charts/fluent-bit-aggregator
appversion: true
versionincrement: none
file: Chart.yaml
key: "$.appVersion"

readme:
name: Update chart README
kind: shell
disablesourceinput: true
spec:
command: helm-docs
dependson:
- appVersion

actions:
default:
kind: github/pullrequest
scmid: default
spec:
title: Updated fluent-bit-aggregator
mergemethod: squash
maintainercannotmodify: true
labels:
- dependencies

0 comments on commit 7f5de39

Please sign in to comment.