-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f63441e
commit ce9d8bd
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Auto Tag | ||
on: [push] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# parse version from git log like `release: 0.0.35` | ||
- name: Get version | ||
id: version | ||
run: echo ::set-output name=version::$(git log --pretty=oneline --grep='release: ' -1 | grep -oP 'release: \K[0-9.]+') | ||
# skip if no version found | ||
- name: Check version | ||
run: echo "Version: ${{ steps.version.outputs.version }}" | ||
- name: Skip if no version | ||
if: steps.version.outputs.version == '' | ||
run: echo "No version found, skipping..." | ||
# create & push tag | ||
- name: Create & push tag | ||
if: steps.version.outputs.version != '' | ||
run: | | ||
git tag v${{ steps.version.outputs.version }} | ||
git push origin v${{ steps.version.outputs.version }} |