Skip to content

Update Jesse version #167

Update Jesse version

Update Jesse version #167

Workflow file for this run

name: Update Jesse version
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install YQ
uses: dcarbone/[email protected]
- name: Get latest Jesse pip version
id: get_latest_version
run: |
LATEST_VERSION=$(curl -s https://pypi.org/pypi/jesse/json | jq -r '.info.version')
echo "Latest Jesse version: $LATEST_VERSION"
echo "latest_version=$LATEST_VERSION" >> $GITHUB_ENV
- name: Read current appVersion from Chart.yaml
id: read_current_version
run: |
CURRENT_VERSION=$(yq '.appVersion' Chart.yaml)
echo "Current Jesse version: $CURRENT_VERSION"
echo "current_version=$CURRENT_VERSION" >> $GITHUB_ENV
- name: Compare versions and update Chart.yaml if needed
id: update_chart
run: |
if [ "$(printf '%s\n' "$latest_version" "$current_version" | sort -V | tail -n1)" != "$current_version" ]; then
echo "New version detected: Updating Chart.yaml..."
yq eval -i ".appVersion = \"$latest_version\"" Chart.yaml
# Increment patch version (e.g., 0.0.11 -> 0.0.12)
CHART_VERSION=$(yq '.version' Chart.yaml)
NEW_CHART_VERSION=$(echo $CHART_VERSION | awk -F. '{print $1"."$2"."$3+1}')
yq eval -i ".version = \"$NEW_CHART_VERSION\"" Chart.yaml
echo "Updated Chart version to $NEW_CHART_VERSION"
echo "chart_updated=true" >> $GITHUB_ENV
else
echo "No new version found. Skipping update."
echo "chart_updated=false" >> $GITHUB_ENV
fi
- name: Create Pull Request
if: env.chart_updated == 'true'
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update Jesse to version ${{ env.latest_version }}
branch: update-jesse-${{ env.latest_version }}
delete-branch: true
title: "Update Jesse to ${{ env.latest_version }}"
body: "Update Jesse Helm Chart appVersion to `${{ env.latest_version }}` and bump patch version."
labels: |
automated