The files_to_ignore parameter takes a whitespace delineated list of patterns to ignore when calculating the size of a PR. The example here (https://github.com/CodelyTV/pr-size-labeler?tab=readme-ov-file#example-for-files_to_ignore) shows it being used to ignore lockfiles like package-lock.json file by simply including that filename. Under the hood this is implemented by doing a pattern match against the full path of any file touched by the PR:
|
for pattern in $files_to_ignore; do |
|
if [[ $filename == $pattern ]]; then |
|
ignore=true |
|
break |
|
fi |
|
done |
That means if you want to ignore package-lock.json regardless of where it is located in the repo, you actually need to use */package-lock.json rather than just package-lock.json. I wouldn't necessarily call this a bug, but it has certainly been a point of confusion for some internal users of this action. A more complete example and a note in the parameter description would go a long way towards helping avoid this confusion. Alternatively the implementation could be updated to invoke basename on the path before comparison.
Happy to throw up a PR if there is appetite for either option.
This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting /reward 100 (replace 100 with the amount).
🕵️♂️ If someone starts working on this issue to earn the rewards, they can comment /try to let everyone know!
🙌 And when they open the PR, they can comment /claim #88 either in the PR description or in a PR's comment.
🪙 Also, everyone can tip any user commenting /tip 20 @rhsai (replace 20 with the amount, and @rhsai with the user to tip).
📖 If you want to learn more, check out our documentation.
The
files_to_ignoreparameter takes a whitespace delineated list of patterns to ignore when calculating the size of a PR. The example here (https://github.com/CodelyTV/pr-size-labeler?tab=readme-ov-file#example-for-files_to_ignore) shows it being used to ignore lockfiles likepackage-lock.jsonfile by simply including that filename. Under the hood this is implemented by doing a pattern match against the full path of any file touched by the PR:pr-size-labeler/src/github.sh
Lines 35 to 40 in 1c34223
That means if you want to ignore
package-lock.jsonregardless of where it is located in the repo, you actually need to use*/package-lock.jsonrather than justpackage-lock.json. I wouldn't necessarily call this a bug, but it has certainly been a point of confusion for some internal users of this action. A more complete example and a note in the parameter description would go a long way towards helping avoid this confusion. Alternatively the implementation could be updated to invokebasenameon the path before comparison.Happy to throw up a PR if there is appetite for either option.
This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting
/reward 100(replace100with the amount).🕵️♂️ If someone starts working on this issue to earn the rewards, they can comment
/tryto let everyone know!🙌 And when they open the PR, they can comment
/claim #88either in the PR description or in a PR's comment.🪙 Also, everyone can tip any user commenting
/tip 20 @rhsai(replace20with the amount, and@rhsaiwith the user to tip).📖 If you want to learn more, check out our documentation.