Intercept issues and comments based on regex matching.
You can use it to close/lock issues and delete comments.
- Required
- Example
"/foo|bar/i""/\btest\.com\b/i"${{ secrets.REGEX_ISSUE_INTERCEPTOR }} - The regex expression to test title or body of the issue or comment.
- These flags of regex are supported:
gimuy. - You can keep it in a secret then other bodies don't know what it is.
- Default
${{ github.token }} - Github token.
- Default
xxx - Reset the title of the issue.
- Default
xxx - Reset the body of the issue or comment.
- Default
spam - Options One of
off-topic,too heated,resolved,spam - The reason for locking the issue conversation.
- The
oncondition isissues.
name: Lock Issue
on:
issues:
types: [opened, edited, reopened]
jobs:
lock-issue:
runs-on: ubuntu-latest
steps:
- name: lock issue
uses: pansong291/issue-interceptor-action@main
with:
test-regex: '/shite/i'
token: ${{ secrets.GITHUB_TOKEN }}
title-override: 'f*ck you'
body-override: 'b*tch'
lock-reason: 'spam'- The
oncondition isissue_comment.
name: Delete Comment
on:
issue_comment:
types: [created, edited]
jobs:
delete-comment:
runs-on: ubuntu-latest
steps:
- name: delete comment
uses: pansong291/issue-interceptor-action@main
with:
test-regex: '/shite/i'
token: ${{ secrets.GITHUB_TOKEN }}- The
oncondition isissuesandissue_comment.
name: Lock Issue And Delete Comment
on:
issues:
types: [opened, edited, reopened]
issue_comment:
types: [created, edited]
jobs:
lock-and-delete:
runs-on: ubuntu-latest
steps:
- name: lock issue and delete comment
uses: pansong291/issue-interceptor-action@main
with:
test-regex: '/shite/i'
token: ${{ secrets.GITHUB_TOKEN }}
title-override: 'f*ck you'
body-override: 'b*tch'
lock-reason: 'spam'- The
oncondition isworkflow_dispatch.
name: Lock Issue And Delete Comment
on:
workflow_dispatch:
jobs:
lock-and-delete:
runs-on: ubuntu-latest
steps:
- name: lock issue and delete comment
uses: pansong291/issue-interceptor-action@main
with:
test-regex: '/shite/i'
token: ${{ secrets.GITHUB_TOKEN }}
title-override: 'f*ck you'
body-override: 'b*tch'
lock-reason: 'spam'- The
oncondition isissuesandissue_commentandworkflow_dispatch.
name: Lock Issue And Delete Comment
on:
issues:
types: [opened, edited, reopened]
issue_comment:
types: [created, edited]
workflow_dispatch:
jobs:
lock-and-delete:
runs-on: ubuntu-latest
steps:
- name: lock issue and delete comment
uses: pansong291/issue-interceptor-action@main
with:
test-regex: '/shite/i'
token: ${{ secrets.GITHUB_TOKEN }}
title-override: 'f*ck you'
body-override: 'b*tch'
lock-reason: 'spam'