Skip to content

Commit

Permalink
Add a workflow to automatically update main tag
Browse files Browse the repository at this point in the history
Signed-off-by: Shakar Bakr <[email protected]>
  • Loading branch information
5h4k4r committed Oct 25, 2023
1 parent c6da395 commit f17732f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/update-main-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
on:
push:
tags:
- v*.*.*

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#v}
major=${version%%.*}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
echo "major=${major}" >> $GITHUB_OUTPUT
- name: force update major tag
run: |
git config user.name github-actions
git config user.email [email protected]
git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f
git push origin refs/tags/v${{ steps.version.outputs.major }} -f

0 comments on commit f17732f

Please sign in to comment.