File tree 3 files changed +15
-4
lines changed
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 62
62
- `fail_if_xl` : Set to `'true'` will report GitHub Workflow failure if the PR size is xl allowing to forbid PR merge
63
63
- `message_if_xl` : Let the user(s) know that the PR exceeds the recommended size and what the consequences are
64
64
- `github_api_url` : Override this parameter in order to use with your own GitHub Enterprise Server. Example: `'https://github.example.com/api/v3'`
65
- - `files_to_ignore` : Whitespace separated list of files to ignore when calculating the PR size. Example: `'package-lock.json Pipfile.lock'`
66
-
65
+ - `files_to_ignore` : Whitespace or newline separated list of files to ignore when calculating the PR size, regex match is supported.
66
+ # ## files_to_ignore Example:
67
+ ` ` ` yml
68
+ files_to_ignore: 'package-lock.json *.lock'
69
+ # OR
70
+ files_to_ignore: |
71
+ "package-lock.json"
72
+ "*.lock"
73
+ "docs/*"
74
+ ` ` `
67
75
# # 🤔 Basic concepts or assumptions
68
76
69
77
- PR size labeler consider as a change any kind of line addition, deletion, or modification
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ bash --version
14
14
source " $PR_SIZE_LABELER_HOME /src/main.sh"
15
15
16
16
for a in " ${@ } " ; do
17
- arg=$( echo " $a " | tr -d ' \n' | sed " s/'//g" | sed " s/’//g" )
17
+ arg=$( echo " $a " | tr ' \n' ' ' | xargs echo | sed " s/'//g" | sed " s/’//g" )
18
18
sanitizedArgs+=(" $arg " )
19
19
done
20
20
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ github::calculate_total_modifications() {
21
21
for file in $( echo " $body " | jq -r ' .[] | @base64' ) ; do
22
22
local ignore_file=0
23
23
for file_to_ignore in $files_to_ignore ; do
24
- if [ " $file_to_ignore " = " $( basename $( jq::base64 ' .filename' ) ) " ]; then
24
+ if [ -z " $file_to_ignore " ]; then
25
+ continue
26
+ fi
27
+ if [[ " $( jq::base64 ' .filename' ) " == $file_to_ignore ]]; then
25
28
ignore_file=1
26
29
fi
27
30
done
You can’t perform that action at this time.
0 commit comments