Skip to content

Create Release Branch #165

Create Release Branch

Create Release Branch #165

# Creates a release branch off of master every Thursday, 7 PM UTC
name: Create Release Branch
# See documentation on POSIX cron syntax here:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events
# Scheduled to run at 7 PM UTC on Wednesday every week. Intended to run
# every-other-week, but POSIX syntax has limited support for that. We can just
# have the job fail every other week because the branch already exists.
on:
schedule:
- cron: "0 19 * * 3"
jobs:
build:
strategy:
fail-fast: true
timeout-minutes: 5
runs-on: ubuntu-latest
# The commit key is necessary in order for this pipeline to trigger a
# subsequent pipeline. Github prevents this behavior by default to prevent
# inifinte loops of workflows
steps:
- name: Checkout and Create Branch
uses: actions/checkout@v3
with:
ref: master
ssh-key: "${{ secrets.COMMIT_KEY }}"
# Bump the version number from what's in package.json for the plugin
- name: Checkout Branch
run: |
git config user.name github-actions
git config user.email github-actions@github.com
version=`cat ./packages/plugin-core/package.json | jq ".version" -r | awk -F. -v OFS=. 'NF>1{$(NF-1)=sprintf("%0*d", length($(NF-1)), ($(NF-1)+1)); $NF=0; print}'`
branchName="release/${version}"
echo $branchName
git checkout -b $branchName
git push origin $branchName