cisagov / manage.get.gov

A Django-based domain name registrar that interfaces with an EPP registry
https://get.gov
Other
60 stars 18 forks source link

Notify users based on issue labels runs and fails when adding a label on a PR #2723

Open abroddrick opened 1 month ago

abroddrick commented 1 month ago

Current Behavior

If Alysia adds a label to a PR to indicate Review Priority or carryover the githhub action "Notify users based on issue labels" is triggered and then fails.

Workflow run on a PR: https://github.com/cisagov/manage.get.gov/actions/runs/10741106356 Error message for the failure: TypeError: Cannot read properties of undefined (reading 'number')

Workflow run (successful) on an Issue: https://github.com/cisagov/manage.get.gov/actions/runs/10741487874

Expected Behavior

This action should only run when "design-review" is added to an issue or a pull request. It should not run for any other label and should not fail when added to a pull request.

Steps to Reproduce

  1. Add a label to a PR
  2. see the action being triggered
  3. see the fail on the action
  4. Creator of label gets an email saying things failed in big scary letters

Environment

github

Additional Context

workflow is the issue-label-notifier.yaml file

I suspect given the libraries name is issue-label-notification-action, that it may just support issues only, and not PRs.

See comments below that suggest switching the libarary used to action-label-notification

Issue Links

No response

abroddrick commented 1 month ago

@katypies and @Katherine-Osos was this meant to work when the label "design-review" is added to pull requests? and has this worked previously? If no objections to removing the pull_request portion from this action let's do that. Otherwise, we can change the expected behavior here to be that it only triggers when "design-review" is added to a pull request and no error occurs for other PR labels.

Refinement added for this message ^^

abroddrick commented 1 month ago

tentatively slotted for 55 just because it's such a quick fix

katypies commented 1 month ago

Meant to be for both Issues and PRs - but I can do some additional investigation.

Adding the actual error message and a link to one of the runs to the ticket to be sure that's captured in-line.

katypies commented 1 month ago

Noting that the original Action from the Github Marketplace hasn't been updated in awhile, and seems to be abandoned. There are a few forks that address some issues, but possibly not in ways we'd want. There's a newer/different one that looks to be more recently maintained, and will also address some of the deprecation notices we're getting as well. https://github.com/iamfj/action-label-notification

It's pretty easy to swap out the .yml file we have and replace it with the formatting for this Action library. Should also be a straightforward fix.

abroddrick commented 1 month ago

Okay based on your comments @katypies I updated the expected behavior and the additional context.

abroddrick commented 1 month ago

Does this looked refined enough to you @katypies ?