Skip to content

feat: centralize assign and completed ui #45

feat: centralize assign and completed ui

feat: centralize assign and completed ui #45

name: Update Version and Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
- name: Extract latest version from CHANGELOG.md
id: get_version
run: |
VERSION=$(grep -oP '\[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md | head -1)
if [ -z "$VERSION" ]; then
echo "No version found in CHANGELOG.md"
exit 1
fi
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Update version in cmd/api/main.go
run: |
sed -i "s/const version = \".*\"/const version = \"${{ steps.get_version.outputs.VERSION }}\"/" cmd/api/main.go
- name: Commit and push if changed
run: |
if git diff --quiet; then
echo "No changes to commit"
exit 0
fi
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add cmd/api/main.go
git commit -m "chore: update api version to ${{ steps.get_version.outputs.VERSION }}"
git push