Skip to content

Alpha Bootstrap

Alpha Bootstrap #6

Workflow file for this run

name: Alpha Bootstrap
on:
create:
permissions:
contents: write
pull-requests: write
jobs:
bootstrap:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Filter only alpha/*.*.* branch creation
id: guard
run: |
RAW_REF="${GITHUB_REF_NAME}" # created branch name
if [[ "$RAW_REF" != alpha/*.*.* ]]; then
echo "Not an alpha/*.*.* branch: $RAW_REF. Exiting."; echo "continue=false" >> $GITHUB_OUTPUT; exit 0; fi
echo "continue=true" >> $GITHUB_OUTPUT
- name: Stop if not alpha pattern
if: steps.guard.outputs.continue != 'true'
run: echo "Skipped"
- name: Derive release branch name
if: steps.guard.outputs.continue == 'true'
id: names
run: |
RAW_REF="${GITHUB_REF_NAME}" # alpha/x.x.x
BASE=${RAW_REF#alpha/}
echo "release_branch=release/$BASE" >> $GITHUB_OUTPUT
- name: Create release branch
if: steps.guard.outputs.continue == 'true'
run: |
git config user.name 'github-actions'
git config user.email 'github-actions@users.noreply.github.com'
git checkout -b "${{ steps.names.outputs.release_branch }}"
git push origin "${{ steps.names.outputs.release_branch }}"
- name: Comment info
if: steps.guard.outputs.continue == 'true'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: 1
body: |
Created release branch `${{ steps.names.outputs.release_branch }}` for alpha `${{ github.ref_name }}`.
(Adjust this workflow to post elsewhere if desired.)