Skip to content

Commit f8701c0

Browse files
authored
docs: add needed permissions in the readme example and how to use with forks (#80)
* Add required permissions for the workflow to run * Set version to 1.10.0 * md formatting * Improve wording * Add note for forks, close #8 * Revert "Set version to 1.10.0" This reverts commit 5f84f9f. * Apply suggestion to use github supported alerts
1 parent e13c249 commit f8701c0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ on: [pull_request]
3636

3737
jobs:
3838
labeler:
39+
permissions:
40+
pull-requests: write
41+
contents: read
42+
issues: write
3943
runs-on: ubuntu-latest
4044
name: Label the PR size
4145
steps:
@@ -60,6 +64,9 @@ jobs:
6064
files_to_ignore: ''
6165
```
6266
67+
> [!TIP]
68+
> 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)).
69+
6370
## 🎛️ Arguments
6471

6572
| Name | Required | Default Value | Description |
@@ -81,7 +88,8 @@ jobs:
8188
| `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. |
8289
| `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. |
8390

84-
### Example for `files_to_ignore`:
91+
### Example for `files_to_ignore`
92+
8593
```yml
8694
files_to_ignore: 'package-lock.json *.lock'
8795
# OR
@@ -92,6 +100,7 @@ files_to_ignore: |
92100
```
93101

94102
## Contributing
103+
95104
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).
96105

97106
## ⚖️ License

src/labeler.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ labeler::label() {
3030
fi
3131

3232
if [ "$fail_if_xl" == "true" ]; then
33-
echoerr "Pr is xl, please, short this!!"
33+
echoerr "PR is xl, please, shorten this!"
3434
exit 1
3535
fi
3636
fi

0 commit comments

Comments
 (0)