Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mrtry/52fe8a60e3e4fe81f5455e9d728281e3 to your computer and use it in GitHub Desktop.
Save mrtry/52fe8a60e3e4fe81f5455e9d728281e3 to your computer and use it in GitHub Desktop.
Merge release branch to master & create tag
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