|
| 1 | +# Pr Smartrr |
| 2 | + |
| 3 | +<div style="display:flex; gap:20px; flex-wrap:wrap"> |
| 4 | + <a href="https://github.com/marketplace/actions/pr-smartrr" style="text-decoration:none"> |
| 5 | + <img src="https://img.shields.io/github/release/UcheSylvester/pr-smartrr.svg" /> |
| 6 | + </a> |
| 7 | + |
| 8 | + <a href="https://github.com/marketplace/actions/pr-smartrr" style="text-decoration:none"> |
| 9 | + <img src="https://img.shields.io/badge/marketplace-pr--smartrr-green?logo=github" /> |
| 10 | + </a> |
| 11 | + |
| 12 | + <a href="https://github.com/marketplace/actions/pr-smartrr" style="text-decoration:none"> |
| 13 | + <img src="https://img.shields.io/github/languages/top/UcheSylvester/pr-smartrr.svg" /> |
| 14 | + </a> |
| 15 | +</div> |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +This GitHub Action automatically requests reviews on pull requests based on changed files. |
| 20 | + |
| 21 | +It does this by checking the teammates with commits on those changed files and adding them as reviewers to pull requests. This means you do not need to manually provide a list of reviewers to this action. |
| 22 | + |
| 23 | +## Inputs |
| 24 | + |
| 25 | +#### `github-token` |
| 26 | + |
| 27 | +**Required** The GitHub token to use for authentication. Typically, this should be set to `${{ secrets.GITHUB_TOKEN }}`. |
| 28 | + |
| 29 | +#### `max-reviewers` |
| 30 | + |
| 31 | +**Optional** The maximum number of reviewers to be added to the pull request. _Defaults to 2_. |
| 32 | + |
| 33 | +## Usage |
| 34 | + |
| 35 | +1. **Create a Workflow YAML File**: In your repository, create or edit a workflow YAML file (e.g., `.github/workflows/main.yml`). |
| 36 | + |
| 37 | +2. **Define the Workflow**: |
| 38 | + |
| 39 | +```yaml |
| 40 | +name: main |
| 41 | + |
| 42 | +on: |
| 43 | + pull_request: |
| 44 | + types: [opened] |
| 45 | + |
| 46 | +defaults: |
| 47 | + run: |
| 48 | + shell: 'bash' |
| 49 | + |
| 50 | +jobs: |
| 51 | + RequestReviews: |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Checkout repository |
| 55 | + uses: actions/checkout@v3 |
| 56 | + with: |
| 57 | + fetch-depth: 0 |
| 58 | + |
| 59 | + - name: Auto PR review requests |
| 60 | + uses: UcheSylvester/pr-smartrr@v0.1.0 |
| 61 | + with: |
| 62 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + max-reviewers: 2 |
| 64 | +``` |
| 65 | +
|
| 66 | +## Run Locally |
| 67 | +
|
| 68 | +To run this action locally, you need to have [Node.js](https://nodejs.org/en/) installed on your machine. |
| 69 | +
|
| 70 | +1. Clone this repository: |
| 71 | +
|
| 72 | +```bash |
| 73 | +git clone |
| 74 | +``` |
| 75 | + |
| 76 | +2. Install dependencies: |
| 77 | + |
| 78 | +```bash |
| 79 | +yarn |
| 80 | +``` |
| 81 | + |
| 82 | +3. Build the typescript: |
| 83 | + |
| 84 | +```bash |
| 85 | +yarn build |
| 86 | +``` |
| 87 | + |
| 88 | +4. Run the tests: |
| 89 | + |
| 90 | +```bash |
| 91 | +yarn test |
| 92 | +``` |
| 93 | + |
| 94 | +5. Run the local action with [nektos/act](https://github.com/nektos/act): |
| 95 | + |
| 96 | +```bash |
| 97 | +act -j pr-labelr -s GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} |
| 98 | +``` |
| 99 | + |
| 100 | +## Contributing |
| 101 | + |
| 102 | +We welcome contributions from the community to make **Pr Smartrr** even better. Whether it's bug fixes, new features, or improvements to documentation, your input is valuable. To contribute, follow these steps: |
| 103 | + |
| 104 | +1. Create an issue describing the feature/bug you want to work on. |
| 105 | +2. Fork the repository on GitHub. |
| 106 | +3. Create a new branch for your changes. |
| 107 | +4. Make your changes and commit them with descriptive messages. |
| 108 | +5. Submit a pull request to the main repository. |
| 109 | + |
| 110 | +## License |
| 111 | + |
| 112 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## Get In Touch |
| 117 | + |
| 118 | +[Email](mailto:okorocode@gmail.com) | [Follow on Twitter](https://twitter.com/ucylvester) | [Connect on LinkedIn](https://www.linkedin.com/in/uchenna-okoro/) | [Report an Issue](https://github.com/UcheSylvester/pr-smartrr/issues) |
0 commit comments