Skip to content

Commit

Permalink
Add Update Version Badge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
117 committed Mar 24, 2024
1 parent 31dccdb commit a012f3a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/update_version_badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update Version Badge
on:
push:
tags:
- "*"
jobs:
update-version-badge:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: get tag
id: get_version
run: echo "::set-output name=TAG::${GITHUB_REF#refs/tags/}"
- name: write json
run: |
echo '{"label": "version", "message": "${{ steps.get_version.outputs.TAG }}"}' > .github/badges/version.json
- name: commit and push
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add .github/badges/version.json
git commit -m "Update version badge to ${{ steps.get_version.outputs.TAG }}"
git push

0 comments on commit a012f3a

Please sign in to comment.