[Feature]自动获取模型列表 #759
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: Remove Question Label on Response | |
| on: | |
| issue_comment: | |
| types: [created] | |
| issues: | |
| types: [edited] | |
| jobs: | |
| remove-question-label: | |
| # Only run if the action is from the issue author (not maintainers) | |
| # This includes both comments and issue edits | |
| if: | | |
| (github.event_name == 'issue_comment' && github.event.issue.user.login == github.event.comment.user.login) || | |
| (github.event_name == 'issues' && github.event.issue.user.login == github.event.sender.login) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Remove question label when user responds or updates issue | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const issue = context.issue; | |
| const labels = context.payload.issue.labels.map(label => label.name); | |
| // Check if the issue has the 'question' label | |
| if (labels.includes('question')) { | |
| console.log('User responded to question or updated issue, removing question label'); | |
| // Remove the question label | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| name: 'question' | |
| }); | |
| console.log('Question label removed successfully'); | |
| } else { | |
| console.log('No question label found, nothing to remove'); | |
| } |