Skip to content

Commit 38c337b

Browse files
Copilotvgoehler
andcommitted
Add workflow to auto-update LiaScript badge URL to latest commit SHA
Co-authored-by: vgoehler <1705385+vgoehler@users.noreply.github.com> Agent-Logs-Url: https://github.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/sessions/9e4625d6-2472-4a6d-96cf-53e9483c8bbd
1 parent bb195d0 commit 38c337b

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update LiaScript Badge
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
update-badge:
9+
name: Update LiaScript badge to latest commit
10+
runs-on: ubuntu-latest
11+
if: github.event.head_commit.author.name != 'github-actions[bot]'
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: Update LiaScript badge URL and commit
21+
run: |
22+
COMMIT_SHA="${{ github.sha }}"
23+
sed -i -E "s|(https://LiaScript\.github\.io/course/\?https://raw\.githubusercontent\.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/)[^)]+/README\.md|\1${COMMIT_SHA}/README.md|g" README.md
24+
git config user.name "github-actions[bot]"
25+
git config user.email "github-actions[bot]@users.noreply.github.com"
26+
git add README.md
27+
git diff --staged --quiet || git commit -m "ci: update LiaScript badge to commit ${COMMIT_SHA::7} [skip ci]"
28+
git push

0 commit comments

Comments
 (0)