Created
May 18, 2021 02:42
-
-
Save mrtry/52fe8a60e3e4fe81f5455e9d728281e3 to your computer and use it in GitHub Desktop.
Merge release branch to master & create tag
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
name: 'Merge `release/x.x.x` to master & create x.x.x tag' | |
on: | |
pull_request: | |
types: | |
- opened | |
jobs: | |
create-tag: | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.pull_request.head.ref, 'release/') | |
steps: | |
- name: Create tag | |
id: create_tag | |
run: | | |
tag=$(echo ${{ github.event.pull_request.head.ref }} | sed 's/release\///') | |
echo ::set-output name=tag::$tag | |
- uses: actions/checkout@v2 | |
- run: | | |
git tag ${{ steps.create_tag.outputs.tag }} | |
git push origin ${{ steps.create_tag.outputs.tag }} | |
merge-to-master: | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.pull_request.head.ref, 'release/') | |
steps: | |
- uses: mtanzi/action-automerge@v1 | |
with: | |
github_token: ${{ github.token }} | |
source: ${{ github.event.pull_request.head.ref }} | |
target: 'master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment