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

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