Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permissions readme #80

Merged
merged 7 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading