[Feat]: 优化坐标轴轴线在存在正负数据时的表现 #2201
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Mark Duplicate Issue | |
| on: | |
| issue_comment: | |
| types: [created, edited] | |
| permissions: {} | |
| jobs: | |
| mark-duplicate: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - name: Mark duplicate issue | |
| uses: actions/github-script@v7.0.1 | |
| with: | |
| script: | | |
| const body = context.payload.comment.body.trim(); | |
| if (!body.startsWith('/duplicate')) return; | |
| const allowedAssociations = new Set(['OWNER', 'MEMBER', 'COLLABORATOR']); | |
| const authorAssociation = context.payload.comment.author_association; | |
| if (!allowedAssociations.has(authorAssociation)) return; | |
| const issueNumber = context.issue.number; | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| // Add 'duplicate' label | |
| await github.rest.issues.addLabels({ owner, repo, issue_number: issueNumber, labels: ['duplicate'] }); | |
| // Remove 'waiting for maintainer' label if present | |
| try { | |
| await github.rest.issues.removeLabel({ owner, repo, issue_number: issueNumber, name: 'waiting for maintainer' }); | |
| } catch (e) { | |
| if (e.status !== 404) throw e; | |
| } | |
| // Close the issue | |
| await github.rest.issues.update({ owner, repo, issue_number: issueNumber, state: 'closed' }); |