Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/chatops_retest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ on:
jobs:
retest:
name: Rerun Failed Actions
uses: tektoncd/plumbing/.github/workflows/_chatops_retest.yml@8441d6ffad5bf64f631ed0e67e46192fdedaca47
uses: tektoncd/plumbing/.github/workflows/_chatops_retest.yml@48c53b4e7f1e0bb206575b80eb9fcf07b5854907
secrets: inherit
30 changes: 30 additions & 0 deletions .github/workflows/rebase-command.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Rebase Command Workflow
#
# This workflow is triggered by the /rebase slash command from the slash.yml workflow.
# It automatically rebases a PR branch against its base branch and force pushes the result.
#
# Usage: Comment `/rebase` on an open pull request
#
# Security Notes:
# - Only users with "write" permission can trigger this command (enforced in slash.yml)
# - Cannot rebase PRs from forks (branch must be in tektoncd/cli)
# - Uses CHATOPS_TOKEN to push rebased branches
# - Uses --force-with-lease for safe force pushing

name: Rebase Command

on:
repository_dispatch:
types: [rebase-command]

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

jobs:
rebase:
name: Rebase PR
uses: tektoncd/plumbing/.github/workflows/_rebase-command.yaml@4e60dd3785868521b0542134f5f57f2989c8883d
secrets:
CHATOPS_TOKEN: ${{ secrets.CHATOPS_TOKEN }}
39 changes: 30 additions & 9 deletions .github/workflows/slash.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
name: Slash Command Routing

permissions:
contents: read

on:
issue_comment:
types: [created]

permissions:
contents: read

jobs:
check_comments:
if: ${{ github.event.issue.pull_request }}
permissions:
issues: write # for peter-evans/slash-command-dispatch to create issue reaction
pull-requests: write # for peter-evans/slash-command-dispatch to create PR reaction
uses: tektoncd/plumbing/.github/workflows/_slash.yml@8441d6ffad5bf64f631ed0e67e46192fdedaca47
secrets: inherit
runs-on: ubuntu-latest
steps:
- name: route-land
uses: peter-evans/slash-command-dispatch@9bdcd7914ec1b75590b790b844aa3b8eee7c683a # v5.0.2
with:
token: ${{ secrets.CHATOPS_TOKEN }}
config: >
[
{
"command": "retest",
"permission": "write",
"issue_type": "pull-request",
"repository": "tektoncd/cli"
},
{
"command": "cherry-pick",
"permission": "write",
"issue_type": "pull-request",
"repository": "tektoncd/cli"
},
{
"command": "rebase",
"permission": "write",
"issue_type": "pull-request",
"repository": "tektoncd/cli"
}
]