Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/cherry-pick-command.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Cherry Pick Command Workflow
#
# This workflow is triggered by the /cherry-pick slash command from the slash.yml workflow.
# It automatically cherry-picks merged PRs to the specified target branches.
#
# Usage: Comment `/cherry-pick <target-branch> [<target-branch> ...]` on a merged pull request
# Example: `/cherry-pick release-v1.0.x`
# Example: `/cherry-pick release-v1.0.x release-v1.1.x`
#
# Security Notes:
# - Only users with "write" permission can trigger this command (enforced in slash.yml)
# - Works safely with PRs from forks because it only cherry-picks already-merged commits
# - Uses CHATOPS_TOKEN to create PRs and push to branches
# - The action creates a new branch from the target branch, not from the fork

name: Cherry Pick Command

on:
repository_dispatch:
types: [cherry-pick-command]

permissions:
contents: write
pull-requests: write
issues: write

jobs:
cherry-pick:
name: Cherry Pick Actions
uses: tektoncd/plumbing/.github/workflows/_cherry-pick-command.yaml@4b57443b85569e5bb7d9ee440bf5cae99cb642cb
secrets:
CHATOPS_TOKEN: ${{ secrets.CHATOPS_TOKEN }}
12 changes: 9 additions & 3 deletions .github/workflows/slash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# named <command>-command which must exist in the repository.
#
# Supported commands:
# - /land: invokes the land-command workflow, to land (merge) PRs
# stacked through ghstack
# - /retest: re-trigger workflows that failed on a given PR
# - /cherry-pick <branch>: cherry-picks the merged PR to the specified branch
#
# When a command is recognised, the rocket and eyes emojis are added

Expand All @@ -36,6 +36,12 @@ jobs:
"command": "retest",
"permission": "write",
"issue_type": "pull-request",
"repository": "tektoncd/pipeline"
"repository": "tektoncd/mcp-server"
},
{
"command": "cherry-pick",
"permission": "write",
"issue_type": "pull-request",
"repository": "tektoncd/mcp-server"
}
]
Loading