-
Notifications
You must be signed in to change notification settings - Fork 12
51 lines (45 loc) · 1.43 KB
/
_cut-release-branches.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 }}