jenschelkopf / issue-label-notification-action

An action to notify individuals or teams when specific labels are added to an issue.
28 stars 21 forks source link

Team mentions in comments does not result in notifications #12

Open krukow opened 4 years ago

krukow commented 4 years ago

I've got a config ala:

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
        - uses: jenschelkopf/issue-label-notification-action@1.2
          with:
             recipients: |
                  help wanted=@org-name/team-name

When the help wanted label is applied I see the comment posted as expected, but the team mention (@org-name/team-name) does not cause notifications to be sent.

Notably this does work for individual mentions (@krukow) but not for org-namespaced/team names @org/team

I've validated that if I create a comment using curl + REST, I do get the results as expected, so I believe the difference must be in this action or in octokit/rest.js?

i.e. this correctly notifies the team:

curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" -H "Authorization: token [REDACTED]" \
  https://api.github.com/repos/[redacted]/[redacted]/issues/[N]/comments \
  -d '{"body":"Heads up @org-name/team-name - the 'help-wanted' label was applied to this issue."}'
dannykopping commented 3 years ago

Bump, ran into this too

krukow commented 3 years ago

cc : @jenschelkopf

javsjmoore commented 2 years ago

Pass your Personal Access Token with the read:org scope to the action. Your .yml will look something like this.

name: Notify users based on issue labels

on:
  issues:
      types: [labeled]

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
        - uses: jenschelkopf/issue-label-notification-action@1.3
          with:
             token: ${{ secrets.GITHUB_TOKEN }}
             recipients: |
                  help wanted=@org-name/team-name