https://github.com/hasithaishere/route-commenter-action
A GitHub Action to add comments to changed routes in PRs.
https://github.com/hasithaishere/route-commenter-action
Last synced: over 1 year ago
JSON representation
A GitHub Action to add comments to changed routes in PRs.
- Host: GitHub
- URL: https://github.com/hasithaishere/route-commenter-action
- Owner: hasithaishere
- License: mit
- Created: 2024-07-31T09:31:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-06T08:00:12.000Z (almost 2 years ago)
- Last Synced: 2025-01-07T12:47:33.211Z (over 1 year ago)
- Language: JavaScript
- Size: 432 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Route Commenter Action
This GitHub Action detects changes in route files within a PR and adds comments to the start of modified route blocks.
## Usage
Create a workflow file in your repository (e.g., `.github/workflows/route-commenter.yml`):
```yaml
name: Route Commenter
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- 'master'
permissions:
contents: read
pull-requests: write
jobs:
comment-routes:
runs-on: ubuntu-latest
steps:
- name: Checkout monorepo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Route Commenter Action
uses: hasithaishere/route-commenter-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_COMMENT_CONTENT_FILE: '.github/config/route-comment-content.md' # Optional: has hardcoded default content
INPUT_TAG_NAME: 'change-route' # Optional: default is 'change-route'
```
Create a route comment content file in your repository (e.g., `.github/config/route-comment-content.md`):
```markdown
# Route change detected:
- [ ] Have you checked ACL middlewares configs?
- [ ] Have you checked the route is not breaking any existing functionality?
- [ ] Have you checked the route is not breaking any existing tests?
- [ ] Have you documented the route changes?
```
This content file will be optional and the default content will be used if not provided.
## For Maintainers
As general, this Github action also use ncc to package the code in to single js file. So in the development please globally install ncc first.
```sh
npm i -g @vercel/ncc --save
```
After your development, please execute following command for building the package file, then push the code to GitHub.
```sh
npm run build
```
## Developers
- [Hasitha Gamage](hasitha@rocketbots.io)
## License
MIT