-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draft script to comment on missing CHANGELOG entry
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Check change log entry | ||
on: | ||
pull_request: | ||
types: [opened, reopened, edited] | ||
|
||
jobs: | ||
ensure_changelog_entry: | ||
permissions: | ||
contents: read | ||
issues: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Find changelog entry | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
// Groups: yes - 1, entry - 2, no - 3 | ||
const regex = /\*\*CHANGELOG entry\*\*\s+(?:(?<answer>yes|yep|yeah)(?:\.\s*(.*))?|(no|nope|none)\.?)\s*(?:\*\*Additional Notes|\*\*How to test|\z)/mi | ||
const matches = context.payload.pull_request.body.match(regex) | ||
// Is author a part of the DataDog/ruby-guild | ||
if (false) { | ||
// Leave comment for DataDog/ruby-guild and | ||
// return | ||
} | ||
console.log(context.payload.pull_request.body) | ||
console.log(matches) | ||
// If main response is missing | ||
//if (undefined == matches.at(1) || undefined == matches.at(3)) { | ||
// await github.rest.issues.createComment({ | ||
// owner: context.repo.owner, | ||
// repo: context.repo.repo, | ||
// issue_number: ${{ github.event.pull_request.number }}, | ||
// body: `Please fill CHANGELOG entry section. | ||
// If your changes need mention in a CHANGELOG | ||
// > Yes. <brief summary to be placed into the change log> | ||
// or as follows if they don't | ||
// > No.`, | ||
// }) | ||
//} |