-
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.
Use github action to increment tag versions on merge (#33)
- Loading branch information
1 parent
738f481
commit 145c263
Showing
1 changed file
with
20 additions
and
16 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 |
---|---|---|
|
@@ -12,22 +12,26 @@ on: | |
type: string | ||
|
||
jobs: | ||
create_tag: | ||
build: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GIT_USER_NAME: "Infra Workleap" | ||
GIT_USER_EMAIL: "[email protected]" | ||
SOURCE_VERSION_MESSAGE: "Automated tag creation" | ||
|
||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.merge_commit_sha }} | ||
fetch-depth: '0' | ||
|
||
- name: Set git author | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Create Git Tag | ||
run: | | ||
echo "Creating tag [${buildVersion}] with message: ${{ env.SOURCE_VERSION_MESSAGE }}" | ||
git config --global user.name "${{ env.GIT_USER_NAME }}" | ||
git config --global user.email "${{ env.GIT_USER_EMAIL }}" | ||
git tag -a ${buildVersion} -m "${{ env.SOURCE_VERSION_MESSAGE }}" | ||
git push origin --tags | ||
- name: Bump version and push tag | ||
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version | ||
env: | ||
DEFAULT_BUMP: patch | ||
INITIAL_VERSION: 1.0.0 | ||
WITH_V: false | ||
PRERELEASE: false |