unsplash / comment-on-pr

A GitHub Action to comment on the relevant open PR when a commit is pushed.
MIT License
150 stars 84 forks source link

Regression introduced in commit 9aac0ab: check_for_duplicate_msg now broken, duplicate_msg_pattern is non-optional #55

Open pretzelhammer opened 2 years ago

pretzelhammer commented 2 years ago

@jeffreyguenther made this commit which introduced a regression.

Before the commit this configuration would work as expected:

name: comment-on-pr example
on: pull_request
jobs:
  example:
    name: sample comment
    runs-on: ubuntu-latest
    steps:
      - name: comment PR
        uses: unsplash/comment-on-pr@v1.3.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          msg: "Check out this message!"
          check_for_duplicate_msg: true

The expectation being: no duplicate "Check out this message!" comment will be posted in the PR if one exists.

However, after the commit, the above configuration WILL ALWAYS post a "Check out this message!" comment even if it already exists on the PR. Please fix this regression because it's really annoying and beats the point of having a check_for_duplicate_msg configuration in the first place, since it breaks it.

A workaround would be to duplicate the msg into the new "optional" duplicate_msg_pattern. The "optional" is in quotes because it's not really optional, it's now required for check_for_duplicate_msg to work at all.

pretzelhammer commented 2 years ago

accidentally closed this, re-opening