Skip to content

Pr action5

Pr action5 #11

Workflow file for this run

name: Create a pull request to other versions
on:
pull_request:
# push: # for test
branches:
- test_action
# - devel
# - UE5_devel_humble
types:
- closed
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
create_pr:
name: create_pr to other branchs
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
strategy:
matrix:
version:
- devel
- UE5_devel_humble
- test_action
steps:
- uses: actions/checkout@v4
if: ${{ matrix.version }} != ${{ github.base_ref }}
with:
ref: ${{ matrix.version }}
- name: Cherry pick and create PR
if: ${{ matrix.version }} != ${{ github.base_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: carloscastrojumo/github-cherry-pick-action@v1.0.1
with:
branch: ${{ matrix.version }}
labels: |
cherry-pick
reviewers: |
${{ github.event.pull_request.user.login }}
# - name: create branch
# if: ${{ matrix.version }} == ${{ github.base_ref }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# echo The PR was merged, ${{ matrix.version }}, ${{ github.base_ref }}, $GITHUB_SHA. ${{ github.event.pull_request.user.login }}
# git checkout -b auto_created_${{ matrix.version }}_$GITHUB_SHA
# git cherry-pick $GITHUB_SHA
# git push -u origin auto_created_${{ matrix.version }}_$GITHUB_SHA
# - name: Create pull request
# if: ${{ matrix.version }} == ${{ github.base_ref }}
# uses: repo-sync/pull-request@v2
# with:
# source_branch: auto_created_${{ matrix.version }}_$GITHUB_SHA
# destination_branch: ${{ matrix.version }}
# pr_title: auto_created_${{ matrix.version }}_$GITHUB_SHA
# github_token: ${{ secrets.GITHUB_TOKEN }}
# todo
# check base_ref == martrix.version
# 1. create branch
# 2. cherry-pick merge commit
# 3. create PR, assign same author, assign same reviewer
# - uses: peter-evans/create-pull-request@v5
# with:
# commit-message: Update xxxx file
# delete-branch: true
# title: Update xxxx file
# reviewers: mziyut