From b5ab6f26208cd8bcf055b4cb1d20c8312474b567 Mon Sep 17 00:00:00 2001 From: Achllle Date: Tue, 23 Jul 2024 10:10:30 -0700 Subject: [PATCH 1/7] Add required permissions for the workflow to run --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 35438af..421c41a 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ on: [pull_request] jobs: labeler: + permissions: + pull-requests: write + contents: read + issues: write runs-on: ubuntu-latest name: Label the PR size steps: From 5f84f9f5cb12909bca84a34b8bcad78ab4fb8758 Mon Sep 17 00:00:00 2001 From: Achllle Date: Tue, 23 Jul 2024 10:11:35 -0700 Subject: [PATCH 2/7] Set version to 1.10.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 421c41a..ace5a8d 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest name: Label the PR size steps: - - uses: codelytv/pr-size-labeler@v1 + - uses: codelytv/pr-size-labeler@v1.10.0 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} xs_label: 'size/xs' From 94b9bec5d5c4bd1ce67751652118e2570cb783af Mon Sep 17 00:00:00 2001 From: Achllle Date: Tue, 23 Jul 2024 10:12:26 -0700 Subject: [PATCH 3/7] md formatting --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ace5a8d..d72f60e 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,8 @@ jobs: | `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. | | `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. | -### Example for `files_to_ignore`: +### Example for `files_to_ignore` + ```yml files_to_ignore: 'package-lock.json *.lock' # OR @@ -96,6 +97,7 @@ files_to_ignore: | ``` ## Contributing + 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). ## ⚖️ License From 73a0079952a6135b1f1d5db4170a778ae8e59452 Mon Sep 17 00:00:00 2001 From: Achllle Date: Tue, 23 Jul 2024 10:17:27 -0700 Subject: [PATCH 4/7] Improve wording --- src/labeler.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/labeler.sh b/src/labeler.sh index b85996e..5a86820 100644 --- a/src/labeler.sh +++ b/src/labeler.sh @@ -30,7 +30,7 @@ labeler::label() { fi if [ "$fail_if_xl" == "true" ]; then - echoerr "Pr is xl, please, short this!!" + echoerr "PR is xl, please, shorten this!" exit 1 fi fi From a07e0de8fc424c18e073013d1efaddf58699d31e Mon Sep 17 00:00:00 2001 From: Achllle Date: Tue, 23 Jul 2024 10:25:38 -0700 Subject: [PATCH 5/7] Add note for forks, close #8 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d72f60e..b3b8c3e 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ jobs: files_to_ignore: '' ``` +**note**: When using forks and where you don't want any PR to be able to execute code, replace `on: [pull_request]` with `on: [pull_request_target]` (see [GitHub docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target)). + ## 🎛️ Arguments | Name | Required | Default Value | Description | From 2c612e5c9538d840751e6bb2e17df27deb91b0f0 Mon Sep 17 00:00:00 2001 From: Achllle Date: Thu, 25 Jul 2024 12:30:54 -0700 Subject: [PATCH 6/7] Revert "Set version to 1.10.0" This reverts commit 5f84f9f5cb12909bca84a34b8bcad78ab4fb8758. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b3b8c3e..5bcdebd 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest name: Label the PR size steps: - - uses: codelytv/pr-size-labeler@v1.10.0 + - uses: codelytv/pr-size-labeler@v1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} xs_label: 'size/xs' From f659ee6d1344a966e37d51864f870f190416a355 Mon Sep 17 00:00:00 2001 From: Achllle Date: Thu, 25 Jul 2024 12:34:01 -0700 Subject: [PATCH 7/7] Apply suggestion to use github supported alerts --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bcdebd..787b16a 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,8 @@ jobs: files_to_ignore: '' ``` -**note**: When using forks and where you don't want any PR to be able to execute code, replace `on: [pull_request]` with `on: [pull_request_target]` (see [GitHub docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target)). +> [!TIP] +> Replace `on: [pull_request]` with `on: [pull_request_target]` when using forks and when you don't want any PR to be able to execute code ([more info: GitHub docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target)). ## 🎛️ Arguments