Create Early Seed Branch #115
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
# Creates an early seed branch off of master every other Wednesday, 7 PM UTC | |
name: Create Early Seed 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="early-seed/${version}" | |
echo $branchName | |
git checkout -b $branchName | |
git push origin $branchName |