mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 04:57:08 +00:00
chore: add GitHub Actions workflow to synchronize version after tag creation
This commit is contained in:
parent
8919019bf3
commit
63b263f995
32
.github/workflows/merge-post.yml
vendored
32
.github/workflows/merge-post.yml
vendored
@ -13,6 +13,38 @@ permissions:
|
|||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
sync-version:
|
||||||
|
name: Sync Version
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ssh-key: "${{ secrets.COMMIT_KEY }}"
|
||||||
|
|
||||||
|
- name: Update Version
|
||||||
|
run: |
|
||||||
|
# Get tag without 'v' prefix
|
||||||
|
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
||||||
|
|
||||||
|
# Update version in .cz.toml
|
||||||
|
sed -i "s/^version = \".*\"/version = \"$TAG_VERSION\"/" .cz.toml
|
||||||
|
|
||||||
|
# Configure git
|
||||||
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
|
||||||
|
# Commit and push if there are changes
|
||||||
|
if git diff --quiet; then
|
||||||
|
echo "Version already synchronized"
|
||||||
|
else
|
||||||
|
git add .cz.toml
|
||||||
|
git commit -m "chore: sync version to ${TAG_VERSION} [skip ci]"
|
||||||
|
git push origin main
|
||||||
|
fi
|
||||||
|
|
||||||
bump-version:
|
bump-version:
|
||||||
name: Cz Bump
|
name: Cz Bump
|
||||||
if: |
|
if: |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user