Skip to content

Commit e9257fb

Browse files
vdemeestertekton-robot
authored andcommitted
feat: add cherry-pick command workflow and fix slash.yml
- Add cherry-pick-command.yaml using plumbing reusable workflow - Enable /cherry-pick command in slash.yml configuration - Fix repository name in slash.yml (was tektoncd/pipeline, now tektoncd/mcp-server) - Update slash-command-dispatch action to v5.0.1 - Uses centralized cherry-pick logic from tektoncd/plumbing Signed-off-by: Vincent Demeester <[email protected]>
1 parent da1fcdf commit e9257fb

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Cherry Pick Command Workflow
2+
#
3+
# This workflow is triggered by the /cherry-pick slash command from the slash.yml workflow.
4+
# It automatically cherry-picks merged PRs to the specified target branches.
5+
#
6+
# Usage: Comment `/cherry-pick <target-branch> [<target-branch> ...]` on a merged pull request
7+
# Example: `/cherry-pick release-v1.0.x`
8+
# Example: `/cherry-pick release-v1.0.x release-v1.1.x`
9+
#
10+
# Security Notes:
11+
# - Only users with "write" permission can trigger this command (enforced in slash.yml)
12+
# - Works safely with PRs from forks because it only cherry-picks already-merged commits
13+
# - Uses CHATOPS_TOKEN to create PRs and push to branches
14+
# - The action creates a new branch from the target branch, not from the fork
15+
16+
name: Cherry Pick Command
17+
18+
on:
19+
repository_dispatch:
20+
types: [cherry-pick-command]
21+
22+
permissions:
23+
contents: write
24+
pull-requests: write
25+
issues: write
26+
27+
jobs:
28+
cherry-pick:
29+
name: Cherry Pick Actions
30+
uses: tektoncd/plumbing/.github/workflows/_cherry-pick-command.yaml@4b57443b85569e5bb7d9ee440bf5cae99cb642cb
31+
secrets:
32+
CHATOPS_TOKEN: ${{ secrets.CHATOPS_TOKEN }}

.github/workflows/slash.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# named <command>-command which must exist in the repository.
1313
#
1414
# Supported commands:
15-
# - /land: invokes the land-command workflow, to land (merge) PRs
16-
# stacked through ghstack
15+
# - /retest: re-trigger workflows that failed on a given PR
16+
# - /cherry-pick <branch>: cherry-picks the merged PR to the specified branch
1717
#
1818
# When a command is recognised, the rocket and eyes emojis are added
1919

@@ -36,6 +36,12 @@ jobs:
3636
"command": "retest",
3737
"permission": "write",
3838
"issue_type": "pull-request",
39-
"repository": "tektoncd/pipeline"
39+
"repository": "tektoncd/mcp-server"
40+
},
41+
{
42+
"command": "cherry-pick",
43+
"permission": "write",
44+
"issue_type": "pull-request",
45+
"repository": "tektoncd/mcp-server"
4046
}
4147
]

0 commit comments

Comments
 (0)