mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-16 12:23:03 +00:00
35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
name: Update Release Badge
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*' # 可按需调整
|
|
|
|
jobs:
|
|
update-badge:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get latest tag
|
|
id: get_tag
|
|
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Update README badge
|
|
run: |
|
|
TAG=${{ steps.get_tag.outputs.tag_name }}
|
|
BADGE="https://img.shields.io/github/actions/workflow/status/qaiu/netdisk-fast-download/maven.yml?branch=$TAG"
|
|
echo "Using badge: $BADGE"
|
|
|
|
# 替换 README 中 badge 行(标记行需特殊注释)
|
|
sed -i -E "s#(!\[release-badge\]\(.*\))##" README.md
|
|
|
|
- name: Commit and push
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git commit -am "🔄 update release badge for ${{ steps.get_tag.outputs.tag_name }}" || echo "No changes"
|
|
git push
|