-
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.
- Loading branch information
Maharavan Sundaram
committed
May 17, 2024
1 parent
fee98f2
commit 3509a49
Showing
2 changed files
with
38 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# GitHub CI build pipeline to trigger the tag creation after the merge | ||
name: CI/CD Pipeline | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- master | ||
|
||
jobs: | ||
TagCreation: | ||
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'Release') | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.merge_commit_sha }} | ||
fetch-depth: '0' | ||
|
||
- name: Parsing tag name from the branch | ||
id: tagDetails | ||
run: | | ||
echo "Branch name is ${{ github.event.pull_request.head.ref }}" | ||
tagName=$(echo ${{ github.event.pull_request.head.ref }} | grep -oP 'v\d+\.\d+\.\d+' | sed 's/^//') | ||
echo "tagName=$tagName" >> $GITHUB_OUTPUT | ||
- name: Tag name | ||
run: | | ||
echo ${{ steps.tagDetails.outputs.tagName }} | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tagDetails.outputs.tagName }} | ||
token: "${{ secrets.GITHUB_TOKEN }}" | ||
generateReleaseNotes: "true" |