Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add auto-release-tagging workflow
Browse files Browse the repository at this point in the history
bdunderscore committed Sep 23, 2023
1 parent e72c55c commit 1259877
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release-tagging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tag releases
on:
push:
branches:
- main

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get current version
run: |
echo current_version=$(jq -r .version package.json) >> $GITHUB_ENV
- name: Check if version is tagged
id: check_tagged
run: |
if git tag -l $current_version; then
echo "Version $current_version is already tagged"
echo "need_tag=false" >> $GITHUB_OUTPUT
else
echo "Version $current_version is not tagged"
echo "need_tag=true" >> $GITHUB_OUTPUT
fi
- name: Tag version
if: steps.check_tagged.outputs.need_tag == 'true'
run: |
git config user.name "Github Actions"
git config user.email "[email protected]"
git tag $current_version
git push origin $current_version

0 comments on commit 1259877

Please sign in to comment.