Skip to content

Create Release Branch #4

Create Release Branch

Create Release Branch #4

name: Create Release Branch
on:
workflow_dispatch:
inputs:
branch_name:
description: 'Name of the new branch'
required: true
jobs:
get-repos:
runs-on: ubuntu-latest
outputs:
repos: ${{ steps.read_config.outputs.repos }}
steps:
- uses: actions/checkout@v4
- name: Get repositories
id: read_config
run: |
REPOS=$(yq e -o=json '.repos | .[] | "\(.org)/\(.repo)"' pkg/config/config.yaml | jq -c -s '.')
echo "repos=${REPOS}" >> "$GITHUB_OUTPUT"
create-branches:
needs: get-repos
runs-on: ubuntu-latest
strategy:
matrix:
repo: ${{ fromJson(needs.get-repos.outputs.repos) }}
steps:
- name: Get Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v3
with:
application_id: ${{ vars.KONVEYOR_BOT_ID }}
application_private_key: ${{ secrets.KONVEYOR_BOT_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
token: ${{ steps.get_workflow_token.outputs.token }}
fetch-depth: 0
- name: Create new branch
run: |
git config --global user.email "[email protected]"
git config --global user.name "Branch Creator"
git checkout -b ${{ inputs.branch_name }}
git push origin ${{ inputs.branch_name }}