A GitHub Action to track similar or duplicated Pull Requests.
Warning This project is under development.
Use this Action on your repository to easily track similar or duplicated Pull Requests. It runs automatically whenever someone opens a new PR and scans all open PRs for different patterns listed on the Features section. The output is a detailed comment with useful information including diff links in case of detected conflicts.
- Automatically gets triggered with new Pull Requests.
- Analyzes all open Pull Requests that modify the same files.
- Checks if there are merge conflicts among the Pull Requests found.
- Creates a detailed comment on the newly created Pull Request.
# .github/workflows/pr-tracker.yml
name: "PR Tracker"
on:
pull_request:
types: [opened]
jobs:
pr-track:
runs-on: ubuntu-latest
steps:
- uses: mateusabelli/pr-tracker@v0.0.1-alphaFor this action to work, you must grant write permissions to the default token that GitHub provides. This is going to allow the internal usage of gh on the scripts.
The settings are located on https://github.com/<OWNER>/<REPOSITORY>/settings/actions.
Under Workflow permissions, select Read and Write permission then click Save.
Warning You must handle the comments cleanup manually, although they are posted only upon PR openings, or with other events added on the workflow action, many activations can cause multiple comments. This will be addressed once the projects matures.
Additional inputs are also available, for normal usage you won't need to modify these but they are available just in case.
- uses: mateusabelli/pr-tracker@v0.0.1-alpha
with:
owner:
repository:
pr_number:
token:| Input | Description | Default |
|---|---|---|
owner |
Name of the owner or organization | github.repository_owner |
repository |
Name of the repository | github.event.repository.name |
pr_number |
Number of the Pull Request | github.event.number |
token |
Token required to use GitHub CLI in the workflow | github.token |
This project was created to participate on the "Maintainers Must-Have" category on the DEV + GitHub Hackathon. My initial idea was to create a tool that could identify if someone is opening a PR that makes the same or similar changes of other contributors with open PRs. To achieve this, I planned three major modules, one for checking pulls, checking conflicts and one for checking hunks.
- Check pulls
- Check conflicts
- Check hunks (In development)
flowchart LR
737386("Check Pulls") --> 885552{"Found Pull Requests?"}
linkStyle 0 stroke:#b1b1b6
885552 -->|"Yes"| 147358[/"Exports new \nenvironment <span>variables</span>"/]
linkStyle 1 stroke:#b1b1b6
885552 -->|"No"| 301196["Do nothing"]
linkStyle 2 stroke:#b1b1b6
147358 --> 170819("Check Conflicts")
linkStyle 3 stroke:#b1b1b6
170819 --> 120741{"Found \nConflicts?"}
linkStyle 4 stroke:#b1b1b6
120741 -->|"Yes"| 860237[/"Exports new \nenvironment variables"/]
linkStyle 5 stroke:#b1b1b6
120741 -->|"No"| 611854["Do nothing"]
linkStyle 6 stroke:#b1b1b6
860237 --> 343045("Comment")
linkStyle 7 stroke:#b1b1b6
349329{"Has new \nenvironment variables?"} -->|"Yes"| 299642[\"Assumes failure and\n<span>write detailed comment</span>"\]
linkStyle 8 stroke:#b1b1b6
349329 -->|"No"| 463077[\"Assumes success <span>and</span>\n<span>write </span><span>simple comment</span>"\]
linkStyle 9 stroke:#b1b1b6
299642 --> 264246(["End"])
linkStyle 10 stroke:#b1b1b6
463077 --> 264246
linkStyle 11 stroke:#b1b1b6
343045 --> 349329
linkStyle 12 stroke:#b1b1b6
907594(["Start"]) --> 737386
linkStyle 13 stroke:#b1b1b6
301196 --> 343045
linkStyle 14 stroke:#b1b1b6
611854 --> 343045
linkStyle 15 stroke:#b1b1b6
Click to expand
All contributions are welcome and appreciated! Please create an Issue or Pull Request if you encounter any problems or have suggestions for improvement.
If you want to say thank you or/and support active development of Pull Request Tracker
- Add a GitHub Star to the project.
- Tweet about the project on your Twitter.
- Write interesting articles about project on Dev.to, Medium or personal blog.
- https://dev.to/devteam/announcing-the-github-dev-2023-hackathon-4ocn
- https://docs.github.com/en/actions/creating-actions
- https://stackoverflow.com/
- https://chat.openai.com/
- https://github.com/matiassingers/awesome-readme
- https://github.com/create-go-app/cli#readme
- https://www.mermaidflow.app/
... and many others missing on the list.
Pull Request Tracker is free and open-source software licensed under the MIT License.
The icon used is from Phosphor Icons licensed under the MIT License.