Skip to content

Commit

Permalink
Add detect package new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Faelayis committed Feb 26, 2024
1 parent 6a748a9 commit ebb0a29
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/detect-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Detect PKG New Version
on:
workflow_dispatch:
push:
branches:
- main
paths:
- package.json

jobs:
tag-create:
if: ${{ github.event_name == 'push' && github.actor != 'github-actions[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Detect PKG Version and Create tag
shell: bash
run: |
PKG_VERSION="v$(cat package.json | jq -r '.version')"
if ! git tag | grep "${PKG_VERSION}"; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a ${PKG_VERSION} -m ${PKG_VERSION}
git push --follow-tags --no-verify --force
fi

0 comments on commit ebb0a29

Please sign in to comment.