Skip to content

Commit

Permalink
feat(op-554): add information to README (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
irenecontreras authored Mar 23, 2021
1 parent f7f13f0 commit d6481cf
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
name: Label the PR size
steps:
- uses: coverwallet/pr-labeler@v1.0.0
- uses: coverwallet/pr-labeler@v1.2.1
with:
xs_max_size: '10'
s_max_size: '100'
Expand Down
66 changes: 65 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,65 @@
# pr-labeler
<br />
<p align="center">
<a href="https://www.coverwallet.com/">
<img src="images/logo.png" alt="Logo" width="400" height="100">
</a>

<h3 align="center">pr-labeler</h3>

<p align="center">
Add label to the pull request depending on the number of changes and the files excluded from the counting
</p>
</p>

## Table of Contents

* [Usage](#usage)
* [Inputs](#inputs)
* [Assumptions](#assumptions)
* [License](#license)

## Usage

You can create a `.github/workflows/pr-labeler.yml` file:

```yaml
name: pr-labeler

on: [pull_request]

jobs:
pr-labeler:
runs-on: ubuntu-latest
name: Label the PR size
steps:
- uses: coverwallet/[email protected]
with:
xs_max_size: '10'
s_max_size: '100'
m_max_size: '500'
l_max_size: '1000'
exclude_files: '.txt'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

```

## Inputs


| Name | Description | Required |
|------|-------------|----------|
| xs_max_size | The maximum number of lines changed for the label named xs | true |
| s_max_size | The maximum number of lines changed for the label named s | true |
| m_max_size | The maximum number of lines changed for the label named m | true |
| l_max_size | The maximum number of lines changed for the label named l | true |
| exclude_files | The regular expression of the type of file or files that we want to exclude from the counting of changes | true |

## Assumptions

- PR size labeler consider as a change any kind of line addition, deletion, or modification
- A PR will be labeled as `xl` if it exceeds the amount of changes defined as `l_max_size`

## License

[MIT](LICENSE)
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: 'Pull Request Sizer'
description: 'Label a PR based on the amount of changes excluding from the counting some customed files'
inputs:
GITHUB_TOKEN:
description: 'GitHub token'
required: true
xs_max_size:
description: 'Max size for a PR to be considered xs'
required: true
Expand All @@ -24,7 +21,6 @@ runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.GITHUB_TOKEN }}
- ${{ inputs.xs_max_size }}
- ${{ inputs.s_max_size }}
- ${{ inputs.m_max_size }}
Expand Down
Binary file added images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d6481cf

Please sign in to comment.