Workflow file for this run
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 a pull request to other versions | |
on: | |
pull_request: | |
# push: # for test | |
branches: | |
- test_action | |
# - devel | |
# - UE5_devel_humble | |
types: | |
- closed | |
workflow_dispatch: | |
permissions: | |
actions: write | |
checks: write | |
contents: write | |
deployments: write | |
id-token: write | |
issues: write | |
discussions: write | |
packages: write | |
pages: write | |
pull-requests: write | |
repository-projects: write | |
security-events: write | |
statuses: 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: Debug | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo ${{ matrix.version }}, ${{ github.base_ref }}, $GITHUB_SHA. ${{ github.event.pull_request.user.login }} | |
- 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.9 | |
with: | |
branch: ${{ matrix.version }} | |
labels: | | |
cherry-pick | |
reviewers: | | |
${{ github.event.pull_request.user.login }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
cherry-pick-branch: auto_created_${{ matrix.version }}_$GITHUB_SHA | |
title: '[cherry-pick to ${{ matrix.version }} from ${{ github.base_ref }}] {old_title}' | |
body: 'Cherry picking #{old_pull_request_id} onto this branch' | |
# - 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 remote update | |
# git fetch --all | |
# git cherry-pick -m 1 --strategy=recursive --strategy-option=theirs $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 |