Create pr-merged.yml #1
This file contains hidden or 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
name: Tag on PR Merge | ||
on: | ||
pull_request: | ||
types: [closed] | ||
jobs: | ||
tag-on-merge: | ||
if: github.event.pull_request.merged == true | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Git | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
- name: Create tag | ||
run: | | ||
TAG_NAME="v$(date +'%Y.%m.%d.%H%M%S')" | ||
git tag $TAG_NAME | ||
git push origin $TAG_NAME |