Skip to content

Commit

Permalink
Merge pull request #4194 from DataDog/fix-thank-you-message-condition
Browse files Browse the repository at this point in the history
Fix change log action condition to write warning
  • Loading branch information
Strech authored Dec 5, 2024
2 parents 838ce44 + a043624 commit f354358
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ensure-changelog-entry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const isMember = ${{steps.membership.outputs.result}}
const regex = /\*\*Change log entry\*\*\s+(?:(?<answer_yes>yes|yep|yeah)(?:\.\s*(?<yes_message>[^\r\n<!-]+))?|(?<answer_no>no|nope|none)\.?)\s*/mi
const entry = context.payload.pull_request.body.match(regex)
const isWriteComment =
!isMember
|| null === entry
null === entry
|| (undefined === entry.groups.answer_yes && undefined === entry.groups.answer_no)
|| (undefined !== entry.groups.answer_yes && undefined === entry.groups.yes_message)
|| (undefined !== entry.groups.answer_yes && "" === entry.groups.yes_message.trim())
Expand Down

0 comments on commit f354358

Please sign in to comment.