You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Support ignoring file deletions
Tweak action.yml
* Tweak the readme description
Co-authored-by: Onkar Ruikar <[email protected]>
* tweak removed file check to include line_deletion var
Co-authored-by: Onkar Ruikar <[email protected]>
* docs: unify the "Basic concepts or assumptions" readme section into the most related arguments to make it easier to read
Improve the existing contribution guide (#74)
* Improve the existing contribution guide
* reorder the contribution steps to push testing up
Co-authored-by: Javier Ferrer González <[email protected]>
* tweak contribution process opener copy
Co-authored-by: Javier Ferrer González <[email protected]>
---------
Co-authored-by: Javier Ferrer González <[email protected]>
Put back accidental deletion
---------
Co-authored-by: Onkar Ruikar <[email protected]>
Co-authored-by: Javier Ferrer González <[email protected]>
Co-authored-by: Rob W <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,10 @@
20
20
21
21
## 🚀 Usage
22
22
23
-
Create a file named `labeler.yml` inside the `.github/workflows` directory and paste the following configuration:
23
+
Create a file named `labeler.yml` inside the `.github/workflows` directory and paste the following configuration.
24
+
25
+
> [!NOTE]
26
+
> Take into account that PR Size Labeler considers any line addition, deletion, or modification as a change by default, but you can configure it with [optional arguments](https://github.com/CodelyTV/pr-size-labeler?tab=readme-ov-file#%EF%B8%8F-arguments) such as `files_to_ignore`, `ignore_file_deletions`, or even `ignore_line_deletions`.
| `GITHUB_TOKEN` | Yes | Automatically supplied| GitHub token needed to interact with the repository. |
61
-
| `xs_label` | No | 'size/xs' | Label for very small-sized PRs. |
62
-
| `xs_max_size` | No | '10' | Maximum number of changes allowed for XS-sized PRs. |
63
-
| `s_label` | No | 'size/s' | Label for small-sized PRs. |
64
-
| `s_max_size` | No | '100' | Maximum number of changes allowed for S-sized PRs. |
65
-
| `m_label` | No | 'size/m' | Label for medium-sized PRs. |
66
-
| `m_max_size` | No | '500' | Maximum number of changes allowed for M-sized PRs. |
67
-
| `l_label` | No | 'size/l' | Label for large-sized PRs. |
68
-
| `l_max_size` | No | '1000' | Maximum number of changes allowed for L-sized PRs. |
69
-
| `xl_label` | No | 'size/xl' | Label for extra-large-sized PRs. |
70
-
| `fail_if_xl` | No | 'false' | Whether to fail the GitHub workflow if the PR size is 'XL' (blocks the merge). |
71
-
| `message_if_xl` | No | Custom message | Message to display when a PR exceeds the 'XL' size limit. |
72
-
| `github_api_url` | No | 'https://api.github.com' | URL for the GitHub API, can be changed for GitHub Enterprise Servers. |
73
-
| `files_to_ignore` | No | '' | Files to ignore during PR size calculation. Supports newline or whitespace delimited list. |
74
-
| `ignore_line_deletions` | No | 'false' | Whether to ignore lines which are deleted when calculating the PR size. If set to 'true', deleted lines will be ignored. |
| `GITHUB_TOKEN` | Yes | Automatically supplied| GitHub token needed to interact with the repository. |
64
+
| `xs_label` | No | 'size/xs' | Label for very small-sized PRs. |
65
+
| `xs_max_size` | No | '10' | Maximum number of changes allowed for XS-sized PRs. |
66
+
| `s_label` | No | 'size/s' | Label for small-sized PRs. |
67
+
| `s_max_size` | No | '100' | Maximum number of changes allowed for S-sized PRs. |
68
+
| `m_label` | No | 'size/m' | Label for medium-sized PRs. |
69
+
| `m_max_size` | No | '500' | Maximum number of changes allowed for M-sized PRs. |
70
+
| `l_label` | No | 'size/l' | Label for large-sized PRs. |
71
+
| `l_max_size` | No | '1000' | Maximum number of changes allowed for L-sized PRs. |
72
+
| `xl_label` | No | 'size/xl' | Label for extra-large-sized PRs. A PR will be labeled as 'xl' if it exceeds the amount of changes defined in `l_max_size` |
73
+
| `fail_if_xl` | No | 'false' | Whether to fail the GitHub workflow if the PR size is 'XL' (blocks the merge). |
74
+
| `message_if_xl` | No | Custom message | Message to display when a PR exceeds the 'XL' size limit. |
75
+
| `github_api_url` | No | 'https://api.github.com' | URL for the GitHub API, can be changed for GitHub Enterprise Servers. |
76
+
| `files_to_ignore` | No | '' | Files to ignore during PR size calculation. Supports newline or whitespace delimited list. |
77
+
| `ignore_line_deletions` | No | 'false' | Whether to ignore lines which are deleted when calculating the PR size. If set to 'true', deleted lines will be ignored. |
78
+
| `ignore_file_deletions` | No | 'false' | Whether to ignore completely deleted files when calculating the PR size. If set to 'true', deleted files will be ignored. Distinct from `ignore_line_deletions` in that it only ignores files which are deleted completely. If `ignore_line_deletions` is used then using `ignore_file_deletions` is redundant. |
75
79
76
80
### Example for `files_to_ignore`:
77
81
```yml
@@ -83,11 +87,6 @@ files_to_ignore: |
83
87
"docs/*"
84
88
```
85
89
86
-
## 🤔 Basic concepts or assumptions
87
-
88
-
- PR Size Labeler considers any line addition, deletion, or modification as a change.
89
-
- A PR will be labeled as 'xl' if it exceeds the amount of changes defined in `l_max_size`.
90
-
91
90
## Contributing
92
91
If you would like to help improve the project, please read the [contribution guidelines](https://github.com/CodelyTV/pr-size-labeler/blob/main/.github/CONTRIBUTIONS.md).
Copy file name to clipboardExpand all lines: src/labeler.sh
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,10 @@ labeler::label() {
10
10
local -r message_if_xl="${11}"
11
11
local -r files_to_ignore="${12}"
12
12
local -r ignore_line_deletions="${13}"
13
+
local -r ignore_file_deletions="${14}"
13
14
14
15
local -r pr_number=$(github_actions::get_pr_number)
15
-
local -r total_modifications=$(github::calculate_total_modifications "$pr_number""${files_to_ignore[*]}""$ignore_line_deletions")
16
+
local -r total_modifications=$(github::calculate_total_modifications "$pr_number""${files_to_ignore[*]}""$ignore_line_deletions""$ignore_file_deletions")
0 commit comments