Skip to content

[Vcpkg] clean PR clutters commit #2

[Vcpkg] clean PR clutters commit

[Vcpkg] clean PR clutters commit #2

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