[Vcpkg] clean PR clutters commit #2
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 | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const prNumber = context.payload.pull_request.number; | |
const prBody = context.payload.pull_request.body; | |
const commentRegex = /<!--[\s\S]*?-->/; | |
const hasComment = commentRegex.test(prBody); | |
if (hasComment) { | |
const comment = "This pull request contains `<!-- ... -->` comments."; | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: prNumber, | |
body: comment | |
}); | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |