Skip to content

[Vcpkg] clean PR clutters commit #5

[Vcpkg] clean PR clutters commit

[Vcpkg] clean PR clutters commit #5

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
});
}