|
1 | | -name: Cherry pick PR into release-1.0 branch |
| 1 | +name: Cherry-Pick into release-1.0 branch |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request_target: |
| 4 | + pull_request: |
| 5 | + types: [closed] |
5 | 6 | branches: |
6 | 7 | - main |
7 | 8 |
|
8 | 9 | jobs: |
9 | | - cherry_pick_release_1_0: |
| 10 | + cherry_pick: |
| 11 | + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'cherry-pick-release-1.0') |
10 | 12 | runs-on: ubuntu-latest |
11 | | - name: Cherry pick into release-1.0 branch |
12 | | - if: ${{ contains(github.event.pull_request.labels.*.name, 'cherry-pick-release-1.0') && github.event.pull_request.merged == true }} |
13 | 13 | steps: |
14 | | - - name: Checkout |
| 14 | + - name: Checkout repository |
15 | 15 | uses: actions/checkout@v4 |
16 | 16 | with: |
17 | 17 | fetch-depth: 0 |
18 | | - - name: Cherry pick into release-1.0 branch |
19 | | - uses: carloscastrojumo/[email protected] |
| 18 | + |
| 19 | + - name: Set up Git |
| 20 | + run: | |
| 21 | + git config user.name "GitHub Actions Bot" |
| 22 | + git config user.email "[email protected]" |
| 23 | +
|
| 24 | + - name: Cherry-pick commit |
| 25 | + run: | |
| 26 | + git checkout release-1.0 |
| 27 | + git cherry-pick ${{ github.event.pull_request.merge_commit_sha }} |
| 28 | +
|
| 29 | + - name: Create Pull Request |
| 30 | + uses: peter-evans/create-pull-request@v5 |
20 | 31 | with: |
21 | | - branch: release-1.0 |
22 | | - labels: | |
23 | | - cherry-pick |
24 | | - reviewers: | |
25 | | - instructlab/ui-maintainers |
26 | | - title: '[cherry-pick] {old_title}' |
27 | | - body: 'Cherry picking #{old_pull_request_id} onto this branch' |
28 | | -env: |
29 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + branch: cherry-pick-${{ github.event.pull_request.number }} |
| 34 | + base: release-1.0 |
| 35 | + title: 'Cherry-pick: Add commit to release-1.0 ${{ github.event.pull_request.title }}' |
| 36 | + body: 'Automatically cherry-picked commit from main branch' |
0 commit comments