Skip to content

Check Cruise Control new releases #107

Check Cruise Control new releases

Check Cruise Control new releases #107

name: Check Cruise Control new releases
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
check-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get current release
id: current_release
run: |
current_release=$(grep appVersion charts/cruise-control/Chart.yaml | awk '{ print $2 }')
echo "current_release=$current_release" >> $GITHUB_OUTPUT
- name: Install updatecli
uses: updatecli/updatecli-action@v2
- name: Update dependencies
run: |
updatecli apply --config .github/updatecli/helm-appversion.yaml --commit=false
- name: Get latest release
id: latest_release
run: |
latest_release=$(grep appVersion charts/cruise-control/Chart.yaml | awk '{ print $2 }')
echo "latest_release=$latest_release" >> $GITHUB_OUTPUT
- name: Check if release changed
id: check_changes
run: |
if [ ${{ steps.latest_release.outputs.latest_release }} != ${{ steps.current_release.outputs.current_release }} ]; then
echo "release_changed=true" >> $GITHUB_OUTPUT
fi
- name: Update README.md Helm Chart
if: steps.check_changes.outputs.release_changed == 'true'
uses: losisin/helm-docs-github-action@v1
with:
chart-search-root: charts/cruise-control
- name: Clean tag release for Cruise Control
id: clean_tag_release
if: steps.check_changes.outputs.release_changed == 'true'
run: |
cc_clean_version_tag=$(echo ${{ steps.latest_release.outputs.latest_release }} | grep -oP '(?<=cc)\d+\.\d+\.\d+')
echo "cc_clean_version_tag=$cc_clean_version_tag" >> $GITHUB_OUTPUT
- name: Create PR with changes
if: steps.check_changes.outputs.release_changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PAT_GITHUB }}
commit-message: "fix: update Cruise Control version to ${{ steps.latest_release.outputs.latest_release }}"
signoff: false
branch: fix/upgrade-cruise-control-appversion-${{ steps.latest_release.outputs.latest_release }}
delete-branch: true
title: '[cruise-control] new release: ${{ steps.latest_release.outputs.latest_release }}'
body: |
Cruise Control version:
- :information_source: Current: `${{ steps.current_release.outputs.current_release }}`
- :up: Upgrade: `${{ steps.latest_release.outputs.latest_release }}`
Changelog: https://github.com/linkedin/cruise-control/releases/tag/${{ steps.clean_tag_release.outputs.cc_clean_version_tag }}
labels: |
auto-pr-bump-version