Skip to content

Commit

Permalink
ci: slash commands workflow (#599)
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Yang <[email protected]>
(cherry picked from commit b26a6fb)
  • Loading branch information
reaver-flomesh committed Dec 31, 2024
1 parent 815378d commit 5e0780d
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/slash-commands-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Specify commands for issues and pull requests
# ---------------------------------------------

hi:
# Post a comment, `{{ author }}` is an author placeholder
comment: hi @{{ author }}

wow:
# Post a comment
# `{{ args.* }}` is command args placeholder
# `{{ input }}` is command input placeholder
comment: wow {{ args.0 }}, and the command args is {{ input }}
# Reactions to be added to comment
reactions: ['+1']

heated:
# Lock the thread
lock: true
# Set a lock reason, such as `off-topic`, `too heated`, `resolved` or `spam`
lockReason: too heated
# Reactions to be added to comment
reactions: ['eyes', 'heart']
# Post a comment
comment: The thread has been temporarily locked.

unheated:
# Unlock the thread
unlock: true

lgtm:
# Add a reaction
reactions: ['+1']
label:
- ok-to-merge
- squash

ok-to-squash:
label:
- ok-to-merge
- squash

label:
label:
# Add labels from args
- '{{ input }}'

unlabel:
label:
# Remove labels from args
- '-{{ input }}'

relabel:
label:
# Remove all labels
- -*
# add label from args
- '{{ input }}'

handover:
# handover issues/PRs to the given users
assign:
- '-*' # first remove all the old assignees
- '{{ input }}'

assign:
# assign issues/PRs to the given users
assign:
- '{{ input }}'

# Optionally, specify commands just for issues
# --------------------------------------------
issues:
pin:
# Pin the issue
pin: true

unpin:
# UnPin the issue
unpin: true

feature:
# Close the issue
close: true
# Post a comment, `{{ author }}` is an author placeholder
comment: >
:wave: @{{ author }}, please use our idea board to request new features.
needs-more-info:
# Close the issue
close: true
# Post a comment, `{{ author }}` is author placeholder
comment: >
@{{ author }}
In order to communicate effectively, we have a certain format requirement for the issue, your issue is automatically closed because there is no recurring step or reproducible warehouse, and will be REOPEN after the offer.
# Optionally, specify commands just for pull requests
# ---------------------------------------------------
pulls:
hello:
# Post a comment, `{{ input }}` is command input placeholder
comment: hello {{ input }}
13 changes: 13 additions & 0 deletions .github/workflows/slash-commands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Slash Commands
on:
issue_comment:
types: [created]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/slash-commands@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: .github/slash-commands-config.yml

0 comments on commit 5e0780d

Please sign in to comment.