😮继续尝试新的方法进行处理

This commit is contained in:
Qinyang Liu 2024-07-04 21:37:22 +08:00 committed by GitHub
parent ed17fefefc
commit e6d1ac3825
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,40 +7,38 @@ on:
jobs:
handle_email_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Add label
- name: Add subscribed label
if: startsWith(github.event.issue.title, '[e-mail]')
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: 'subscribe'
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]')
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PAT_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '您已订阅本站更新,若有新文章将通过邮箱推送给您,谢谢!'
})
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/github-script@v6
with:
github-token: ${{ secrets.PAT_TOKEN }}
script: |
github.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed'
})
run: |
gh issue edit $NUMBER --state closed
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}