-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #488 from adigidh/484-workflow
Setup Github Action workflow for auto cherry picking commits
- Loading branch information
Showing
1 changed file
with
24 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,36 @@ | ||
name: Cherry pick PR into release-1.0 branch | ||
name: Cherry-Pick into release-1.0 branch | ||
|
||
on: | ||
pull_request_target: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
cherry_pick_release_1_0: | ||
cherry_pick: | ||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'cherry-pick-release-1.0') | ||
runs-on: ubuntu-latest | ||
name: Cherry pick into release-1.0 branch | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'cherry-pick-release-1.0') && github.event.pull_request.merged == true }} | ||
steps: | ||
- name: Checkout | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Cherry pick into release-1.0 branch | ||
uses: carloscastrojumo/[email protected] | ||
|
||
- name: Set up Git | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "[email protected]" | ||
- name: Cherry-pick commit | ||
run: | | ||
git checkout release-1.0 | ||
git cherry-pick ${{ github.event.pull_request.merge_commit_sha }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
branch: release-1.0 | ||
labels: | | ||
cherry-pick | ||
reviewers: | | ||
instructlab/ui-maintainers | ||
title: '[cherry-pick] {old_title}' | ||
body: 'Cherry picking #{old_pull_request_id} onto this branch' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: cherry-pick-${{ github.event.pull_request.number }} | ||
base: release-1.0 | ||
title: 'Cherry-pick: Add commit to release-1.0 ${{ github.event.pull_request.title }}' | ||
body: 'Automatically cherry-picked commit from main branch' |