diff --git a/.github/workflows/_cut-release-branches.yaml b/.github/workflows/_cut-release-branches.yaml new file mode 100644 index 0000000..b76a6c6 --- /dev/null +++ b/.github/workflows/_cut-release-branches.yaml @@ -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.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 "noreply@github.com" + git config --global user.name "Branch Creator" + git checkout -b ${{ inputs.branch_name }} + git push origin ${{ inputs.branch_name }} + diff --git a/pkg/config/config.yaml b/pkg/config/config.yaml index 6b481cb..a1796e4 100644 --- a/pkg/config/config.yaml +++ b/pkg/config/config.yaml @@ -43,6 +43,8 @@ repos: repo: tackle2-addon-analyzer - org: konveyor repo: tackle2-addon-discovery + - org: konveyor + repo: fernflower # Labels # List of labels, their color and description, that should exist in the specified repositories.