Skip to content

last hotfix

last hotfix #4

Workflow file for this run

name: update_version_on_tag
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
update-readme:
if: "!contains(github.event.head_commit.message, '[automated] Update version')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
# README
- name: Update README.md badges
run: |
current_time=$(date +%s)
sed -i 's/\(ver=\)[0-9]*/\1'"$current_time"'/g' README.md
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "[automated] Update version to ${{ steps.get_version.outputs.VERSION }}"
- name: Push changes
run: |
git push origin HEAD:${{ github.event.repository.default_branch }}
- name: Move tag
run: |
git push --delete origin ${{ github.ref }}
git tag -fa ${{ github.ref_name }} -m "[automated] Update version to ${{ steps.get_version.outputs.VERSION }}"
git push origin ${{ github.ref_name }}