Asana / comment-on-task-github-action

26 stars 15 forks source link

How to limit comments to only once? #3

Open mosherc opened 2 years ago

mosherc commented 2 years ago

I would like to add our netlify build links to our tasks, which works and I can do this, but sometimes someone might forget to add the Asana link to the PR description, so in order to accommodate this scenario, I am using the edited pull_request event. This however triggers the comment to be added every time the developer changes the description, whether they are adding a new unrelated note, or changing the asana task link, or whatever else. Is there any way to limit this? Maybe to once per PR? Maybe only when the asana task URL changes between job runs? Ideally everyone remembers to add the link so opened would work, but I don't think it will (sometimes I forget to add the link at first).

mosherc commented 2 years ago

I ended up using a regex action to determine if the newly edited body includes an asana link while the old one does not. Not perfect but it will do.