-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.08 KB
/
Copy pathupdate-badge.yml
File metadata and controls
38 lines (31 loc) · 1.08 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
38
name: Update README Version Badge
on:
push:
branches: [ main ]
paths: [ 'docker_tool_suite.sh' ]
jobs:
update-readme:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version and update README
run: |
RAW_VERSION=$(grep -oP '^SCRIPT_VERSION=\K.*' docker_tool_suite.sh)
if [ -z "$RAW_VERSION" ]; then
echo "Error: Could not find SCRIPT_VERSION in docker_tool_suite.sh!"
exit 1
fi
echo "Detected version: $RAW_VERSION"
sed -i -E "s|(version-)[^ ]+(-blue)|\1${RAW_VERSION}\2|g" README.md
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add README.md
if ! git diff --staged --quiet; then
git commit -m "SYNC: Bumping badge version to ${RAW_VERSION}"
git push
fi