Skip to content

Commit

Permalink
Auto Create Tag Script
Browse files Browse the repository at this point in the history
  • Loading branch information
keede7 authored Mar 24, 2024
2 parents 1618bb2 + 3d894bf commit de7fe58
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Create Release Tag with to merge main branch

on:
pull_request:
branches:
- main

jobs:
release-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check branch name pattern for PRs
if: ${{ github.event_name == 'pull_request' }}
id: check_branch_pattern
run: |
BRANCH_PATTERN="^[0-9]+.[0-9]+.[0-9]+$" # x.x.x format
PR_BRANCH_NAME=$(jq --raw-output .pull_request.head.ref $GITHUB_EVENT_PATH)
if [[ ! $PR_BRANCH_NAME =~ $BRANCH_PATTERN ]]; then
echo "::set-output name=skip::true"
fi
- name: Create and Push Tag
run: |
VERSION=${{ github.head_ref }}
git tag -a $VERSION -m "Release $VERSION"
git push origin $VERSION

0 comments on commit de7fe58

Please sign in to comment.