[AUTOCUT] Integration Test Failed for sql-3.6.0 #43
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 duplicate label on activity | |
| on: | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| issues: write | |
| jobs: | |
| remove-duplicate: | |
| if: | | |
| github.event.issue.state == 'open' && | |
| contains(github.event.issue.labels.*.name, 'duplicate') && | |
| github.event.comment.user.type != 'Bot' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Remove duplicate label | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const issueNumber = context.issue.number; | |
| const commenter = context.payload.comment.user.login; | |
| console.log(`Removing duplicate label from issue #${issueNumber} due to comment from ${commenter}`); | |
| try { | |
| await github.rest.issues.removeLabel({ | |
| owner, | |
| repo, | |
| issue_number: issueNumber, | |
| name: 'duplicate', | |
| }); | |
| console.log(`Successfully removed duplicate label from issue #${issueNumber}`); | |
| } catch (error) { | |
| if (error.status === 404) { | |
| console.log(`duplicate label was already removed from issue #${issueNumber}`); | |
| } else { | |
| throw error; | |
| } | |
| } |