Also run label workflow on syncronize events#13
Also run label workflow on syncronize events#13cranberry-platypus wants to merge 6 commits intoswe-productivity:mainfrom
syncronize events#13Conversation
david-allison
left a comment
There was a problem hiding this comment.
LGTM, thanks so much!
synchronize is better documented here:
A pull request's head branch was updated. For example, the head branch was updated from the base branch or new commits were pushed to the head branch.
https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=synchronize#pull_request
david-allison
left a comment
There was a problem hiding this comment.
Actually... re-reviewing the logic and your testing, I believe addComments would be called multiple times in the case of:
- label added
- label removed
- label added
Anki-Android/.github/workflows/label.yml
Lines 154 to 158 in 0990960
Could you check this, and confirm whether the comment is only added once (& fix if necessary).
c356d76 to
74b4cf6
Compare
- Add step to delete comments if no strings changes exist - Only add comment if strings label wasn't already added to PR
|
That's a really good catch. I've added some logic to handle this case, as well as some additional cleanup logic for the comment. Now, a new comment is only added when the strings label is first added (a new check was added), and when the strings label is removed, the comment is also removed. |
Purpose / Description
The labels actions for pull requests did not run on every update, but only when they
are opened and closed. This means that removing updates to strings in a PR would not remove
the
Stringslabel.Fixes
Approach
The action already had logic to remove the
Stringslabel, the only change was to changethe workflow trigger to include any updates to the PR.
How Has This Been Tested?
Testing this is non-trivial, since a PR uses the workflows from the target branch. So,
for example, this PR would (the study repo has actions disabled) use the version of the
workflows on the main branch, not the updated ones in this PR. To test, I merged the
changes into the main branch of my fork, and opened a test PR:
cranberry-platypus#1
Learning (optional, can help others)
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
Checklist
Please, go through these checks before submitting the PR.