Skip to content

Commit

Permalink
Update issues.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Deep-Dark-Forest authored Jan 28, 2025
1 parent 881a123 commit b900e7f
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- closed

jobs:
manage_issues:
manage_issues:
runs-on: ubuntu-latest

steps:
Expand All @@ -33,3 +33,34 @@ jobs:
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
-d '{"state": "closed", "state_reason": "completed"}'
fi
add-labels:
runs-on: ubuntu-latest
steps:
- name: Check if the issue was closed as completed and add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.SHEEP }}
script: |
if (context.payload.issue.state_reason === 'completed') {
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['👌 完成']
});
}
- name: Check if the issue was closed as duplicate and add label
uses: actions/github-script@v6
with:
github-token: ${{ secrets.SHEEP }}
script: |
if (context.payload.issue.state_reason === 'duplicate') {
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['❌ 重复']
});
}

0 comments on commit b900e7f

Please sign in to comment.