Skip to content

Commit

Permalink
Use github action to increment tag versions on merge (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
starcraft66 authored Sep 27, 2024
1 parent 738f481 commit 145c263
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/terraform-create-git-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 145c263

Please sign in to comment.