Skip to content

Commit 01528a2

Browse files
authored
Merge pull request #126 from TUBAF-IfI-LiaScript/copilot/add-last-commit-link-to-readme
Auto-update LiaScript badge URL to latest commit SHA to bypass caching
2 parents ac169b9 + 38c337b commit 01528a2

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)