Skip to content

create-release-pr

create-release-pr #1

name: create-release-pr
on:
workflow_dispatch:
jobs:
create-release-pr:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: batch-changes
uses: miniscruff/changie-action@v2
with:
version: latest
args: batch patch
- name: merge-changes
uses: miniscruff/changie-action@v2
with:
version: latest
args: merge
- name: print the latest version
id: latest
uses: miniscruff/changie-action@v2
with:
version: latest
args: latest
- name: print the latest version without "v"
id: latest-no-v
uses: miniscruff/changie-action@v2
with:
version: latest
args: latest --remove-prefix
- name: check-chart-version
run: |
VERSION=${{ steps.latest-no-v.outputs.output }}
APP_VERSION=$(grep '^appVersion:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"')
CHART_VERSION=$(grep '^version:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"')
if [ "$APP_VERSION" != "$VERSION" ] || [ "$CHART_VERSION" != "$VERSION" ]; then
echo "Version mismatch: appVersion ($APP_VERSION) or version ($CHART_VERSION) does not match expected version ($VERSION). You most likely forgot to bump the version in Chart.yaml, please do so."
exit 1
else
echo "Version matches: appVersion ($APP_VERSION) and version ($CHART_VERSION) are both $VERSION."
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: Release ${{ steps.latest.outputs.output }}
branch: release/${{ steps.latest.outputs.output }}
commit-message: Release ${{ steps.latest.outputs.output }}
token: ${{ github.token }}