Skip to content

Commit

Permalink
Merge pull request #488 from adigidh/484-workflow
Browse files Browse the repository at this point in the history
Setup Github Action workflow for auto cherry picking commits
  • Loading branch information
vishnoianil authored Jan 24, 2025
2 parents 7a3b95a + c056901 commit 901b1e2
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions .github/workflows/cherry-pick.yml
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'

0 comments on commit 901b1e2

Please sign in to comment.