chore(github): Migrate to renovate GH action (#2520)
chore: Migrate to renovate GH action Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
parent
48824664e9
commit
e0f6a16ce8
5 changed files with 104 additions and 75 deletions
57
.github/workflows/chart-version-bump.yml
vendored
57
.github/workflows/chart-version-bump.yml
vendored
|
|
@ -1,57 +0,0 @@
|
|||
## Used on Renovate PRs to bump the chart version and add a changelog entry
|
||||
## Reference: https://github.com/stefanzweifel/git-auto-commit-action
|
||||
## Reference: https://github.com/marketplace/actions/changed-files
|
||||
name: 'Chart Version Bump and Changelog'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
helm-bumper:
|
||||
if: ${{ (contains(github.event.pull_request.labels.*.name, 'renovate')) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@3f54ebb830831fc121d3263c1857cfbdc310cdb9 # v42.0.4
|
||||
with:
|
||||
files: charts/{argo-workflows,argo-cd,argo-events,argo-rollouts,argocd-image-updater}/Chart.yaml
|
||||
|
||||
- name: "Bump Version and Changelog"
|
||||
run: |
|
||||
chartName="$(echo \"${{ steps.changed-files.outputs.all_changed_files }}\" | cut -d '/' -f2)"
|
||||
echo "Changed chart name is: $chartName"
|
||||
echo "----------------------------------------"
|
||||
|
||||
parentDir="charts/${chartName}"
|
||||
|
||||
# Bump the chart version by one patch version
|
||||
version=$(grep '^version:' ${parentDir}/Chart.yaml | awk '{print $2}')
|
||||
major=$(echo $version | cut -d. -f1)
|
||||
minor=$(echo $version | cut -d. -f2)
|
||||
patch=$(echo $version | cut -d. -f3)
|
||||
patch=$(expr $patch + 1)
|
||||
sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" ${parentDir}/Chart.yaml
|
||||
|
||||
# Add a changelog entry
|
||||
appVersion=$(grep '^appVersion:' ${parentDir}/Chart.yaml | awk '{print $2}')
|
||||
sed -i -e '/^ artifacthub.io\/changes: |/,$d' ${parentDir}/Chart.yaml
|
||||
echo " artifacthub.io/changes: |" >> ${parentDir}/Chart.yaml
|
||||
echo " - kind: changed" >> ${parentDir}/Chart.yaml
|
||||
echo " description: Bump ${chartName} to ${appVersion}" >> ${parentDir}/Chart.yaml
|
||||
cat ${parentDir}/Chart.yaml
|
||||
|
||||
- name: "Commit and push changes"
|
||||
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
|
||||
with:
|
||||
commit_options: '--signoff'
|
||||
36
.github/workflows/renovate.yaml
vendored
Normal file
36
.github/workflows/renovate.yaml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: Renovate
|
||||
on:
|
||||
# The "*" (#42, asterisk) character has special semantics in YAML, so this
|
||||
# string has to be quoted.
|
||||
schedule:
|
||||
- cron: '0 * * * *'
|
||||
# Manual trigger is also possible
|
||||
workflow_dispatch: {}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get token
|
||||
uses: actions/create-github-app-token@f4c6bf6752984b3a29fcc135a5e70eb792c40c6b # v1.8.0
|
||||
id: get_token
|
||||
with:
|
||||
app-id: ${{ vars.RENOVATE_APP_ID }}
|
||||
private-key: ${{ secrets.RENOVATE_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@2d90417499f45ff78a09586f7b9874b19817dba3 # v40.1.0
|
||||
with:
|
||||
configurationFile: .github/configs/renovate-config.js
|
||||
# renovate: datasource=docker depName=ghcr.io/renovatebot/renovate
|
||||
renovate-version: 37.192.1
|
||||
token: '${{ steps.get_token.outputs.token }}'
|
||||
env:
|
||||
LOG_LEVEL: 'debug'
|
||||
RENOVATE_REPOSITORIES: '${{ github.repository }}'
|
||||
Loading…
Add table
Add a link
Reference in a new issue