chore(release): 20.0.0 #221
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: Tag release commit | |
on: | |
# Trigger the workflow on push only for the master branch | |
push: | |
branches: | |
- master | |
env: | |
NODE_ENV: 'development' | |
GITHUB_TOKEN: ${{ secrets.BRANCH_CREATOR_TOKEN }} | |
jobs: | |
tag: | |
runs-on: ubuntu-latest | |
# Only run on a release commit | |
if: "startsWith(github.event.head_commit.message, 'chore(release):')" | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
token: ${{ secrets.BRANCH_CREATOR_TOKEN }} | |
- run: echo "RELEASE_VERSION=$(git log -1 --pretty=%s)" >> $GITHUB_ENV | |
# parse out non-tag text | |
- run: echo "RELEASE_VERSION=$( echo $RELEASE_VERSION | sed 's/chore(release)://' )" >> $GITHUB_ENV | |
# remove spaces, but add back in `v` to tag, which is needed for standard-version | |
- run: echo "RELEASE_VERSION=v$(echo $RELEASE_VERSION | tr -d '[:space:]')" >> $GITHUB_ENV | |
- run: echo $RELEASE_VERSION | |
- run: git tag $RELEASE_VERSION | |
- name: push version bump commit and tags | |
uses: ad-m/github-push-action@master | |
with: | |
branch: master | |
tags: true |