-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David Zager <[email protected]>
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Create Release Branch | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch_name: | ||
description: 'Name of the new branch' | ||
required: true | ||
from: | ||
description: 'Name of the new branch' | ||
required: false | ||
default: 'main' | ||
|
||
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 }} | ||
ref: ${{ inputs.from }} | ||
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: | ||
GH_TOKEN: ${{ steps.get_workflow_token.outputs.token }} | ||
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 }} | ||
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