44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Handle Email Issues
|
|
|
|
on:
|
|
issues:
|
|
types: [opened]
|
|
|
|
jobs:
|
|
handle_email_issues:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
issues: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Add subscribed label
|
|
if: startsWith(github.event.issue.title, '[e-mail]')
|
|
run: |
|
|
gh issue edit $NUMBER --add-label subscribed
|
|
env:
|
|
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
NUMBER: ${{ github.event.issue.number }}
|
|
|
|
- name: Comment on issue
|
|
if: startsWith(github.event.issue.title, '[e-mail]')
|
|
run: |
|
|
gh issue comment $NUMBER --body "$BODY"
|
|
env:
|
|
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
NUMBER: ${{ github.event.issue.number }}
|
|
BODY: >
|
|
您已订阅本站更新,若有新文章将通过邮箱推送给您,谢谢!
|
|
|
|
- name: Close issue
|
|
if: startsWith(github.event.issue.title, '[e-mail]')
|
|
uses: actions-cool/issues-helper@v3
|
|
with:
|
|
actions: 'close-issue'
|
|
token: ${{ secrets.PAT_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|