-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (32 loc) · 1.03 KB
/
Copy pathsync-version.yml
File metadata and controls
37 lines (32 loc) · 1.03 KB
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
34
35
36
37
name: Sync VERSION to README
on:
push:
branches:
- main
paths:
- 'VERSION'
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Read VERSION
id: ver
run: echo "version=$(cat VERSION | tr -d '[:space:]')" >> "$GITHUB_OUTPUT"
- name: Update README.md version strings
run: |
VERSION="${{ steps.ver.outputs.version }}"
sed -i -E "s/Coderive v[0-9]+\.[0-9]+\.[0-9]+/Coderive v${VERSION}/g" README.md
- name: Commit updated README if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if git diff --quiet README.md; then
echo "README.md already up to date — nothing to commit."
else
git add README.md
git commit -m "chore: sync README version to v${{ steps.ver.outputs.version }} [skip ci]"
git push
fi