Skip to content

Commit

Permalink
docs: add needed permissions in the readme example and how to use wit…
Browse files Browse the repository at this point in the history
…h 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
  • Loading branch information
Achllle authored Jul 26, 2024
1 parent e13c249 commit f8701c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -60,6 +64,9 @@ jobs:
files_to_ignore: ''
```
> [!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

| Name | Required | Default Value | Description |
Expand All @@ -81,7 +88,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
Expand All @@ -92,6 +100,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
Expand Down
2 changes: 1 addition & 1 deletion src/labeler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f8701c0

Please sign in to comment.