fix: Comment on PR only if the XL label is new #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
This PR addresses issue #19 by publishing the
message_if_xl
only when thexl_label
is being added to the PR (either the first time, or when the size changes).This behavior should cover most use cases while reducing spamming:
XL
--> Publish message (notify the author)XL
PR --> No message (the author has already been notified once)XL
PR becomesM
and then againXL
--> Publish message (notify the author again)The principle behind the solution is that the developer/author should be notified only when the PR becomes
XL
, and not every time a change is pushed to the same PR. Although discouraged,XL
PRs are sometimes inevitable, and the developer is well aware of the number of changes he's working with...Notes to Reviewer
There is potential to refactor the
jq::base64
function into a more generic one that does not read the input from$file
but from a positional argument instead. This would allow it to be reused as part of the proposed changes (instead ofecho ${label} | base64 --decode | jq -r '.name'
).How to test
L
PR --> theSize: L
label should be addedXL
--> label should change toSize: XL
and a comment should be publishedSize: L
(removeSize: XL
), and rerun the workflow --> label should change toSize: XL
and a second comment should be publishedLink to issues addressed