Create Release Branch #2
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: 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: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ matrix.repo }} | |
fetch-depth: 0 | |
- 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: Create new branch | |
env: | |
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} | |
run: | | |
git config --global user.email "noreply@github.com" | |
git config --global user.name "Branch Creator" | |
git checkout -b ${{ inputs.branch_name }} | |
git push origin ${{ inputs.branch_name }} | |