Skip to content
Discussion options

You must be logged in to vote

Here's a minimal working example GitHub Action workflow that does exactly what you're trying to do:

name: Cherry-pick to next-release

on:
  pull_request:
    types: [closed]
    branches: [main]

jobs:
  cherry-pick:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4

      - name: Set up Git
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

      - name: Fetch all branches
        run: git fetch --all

      - name: Create cherry-pick branch
        run: |
          git checkout origin…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rfsmart-btomblinson
Comment options

@jheisonnovak
Comment options

Answer selected by rfsmart-btomblinson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Requests Propose, review, and discuss changes to a repository's codebase Question Ask and answer questions about GitHub features and usage
2 participants