[Vcpkg] clean PR clutters commit #5
Workflow file for this run
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
name: Check PR Comments Message | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
Check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Check PR body for comments | |
id: check_pr_body | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const prNumber = context.payload.pull_request.number; | |
const prBody = context.payload.pull_request.body; | |
const commentRegex = /<!--.*-->/; | |
const hasComment = commentRegex.test(prBody); | |
if (hasComment) { | |
const comment = "This pull request comments contains `<!-- ... -->` comments."; | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: prNumber, | |
body: comment | |
}); | |
} |