-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 921 Bytes
/
Copy pathupdate-readme.yml
File metadata and controls
33 lines (28 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Update README version
on:
push:
branches:
- main
workflow_dispatch:
jobs:
update-readme:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version from build.gradle.kts
run: |
VERSION=$(grep -m1 'version = ' axs/build.gradle.kts | sed 's/.*version = "\(.*\)".*/\1/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Replace version in README
run: sed -i "s/[0-9]\+\.[0-9]\+\.[0-9]\+/${{ env.VERSION }}/g" README.md
- name: Commit and push
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add README.md
git diff --cached --quiet || git commit -m "docs: bump version to ${{ env.VERSION }}"
git push