🎵 Billie Eilish - BLUE #12
This file contains 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
on: | |
issues: | |
types: [opened, reopened] | |
permissions: | |
issues: write | |
jobs: | |
process_issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check issue content | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const issueBody = context.payload.issue.body; | |
const remarksSection = /### 备注\n\n_No response_\n\n?/; | |
if (remarksSection.test(issueBody)) { | |
const updatedBody = issueBody.replace(remarksSection, '').trim(); | |
await github.rest.issues.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
body: updatedBody | |
}); | |
console.log(`Removed '### 备注\n\n_No response_\n\n' section from issue #${context.issue.number}.`); | |
} else { | |
console.log('No matching remarks section found or value is not "_No response_".'); | |
} |