Skip to content

playsrc/pr-tracker-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pull Request Tracker

A GitHub Action to track similar or duplicated Pull Requests.


Warning This project is under development.

Getting Started

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.

Features

  • 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.

Usage

# .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-alpha

Requirements & Limitations

For 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.

Optional inputs

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

Motivation

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.

Modules Development

  • Check pulls
  • Check conflicts
  • Check hunks (In development)

How it works

Flowchart

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
Loading

Composed comment

Click to expand

Contributing

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

Acknowledgments

... and many others missing on the list.

License

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.

About

A GitHub Action to track similar or duplicated Pull Requests.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages