Skip to content

Commit

Permalink
upudate
Browse files Browse the repository at this point in the history
  • Loading branch information
yuokamoto committed Nov 3, 2023
1 parent 3dab099 commit d190992
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ permissions:

jobs:
create_pr:
name: create_pr to other branchs
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
strategy:
Expand All @@ -28,26 +29,38 @@ jobs:
- test_action
steps:
- uses: actions/checkout@v4
if: ${{ matrix.version }} == ${{ github.base_ref }}
if: ${{ matrix.version }} != ${{ github.base_ref }}
with:
ref: ${{ matrix.version }}
- name: create branch
if: ${{ matrix.version }} == ${{ github.base_ref }}
- name: Cherry pick and create PR
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
uses: carloscastrojumo/github-cherry-pick-action@v1.0.1
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 }}
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
Expand Down

0 comments on commit d190992

Please sign in to comment.