🚊 A GitHub Action that labels PRs with the repo(s) impacted in a monorepo.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci wip Jan 21, 2019
docs
tests
.gitignore
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
app.js
dev.example
entrypoint.sh
helpers.js
package-lock.json
package.json

README.md

🚊 Monorepo PR Repo Labeler - GitHub Action

A GitHub Action that labels pull requests with the repo(s) that they impact in a monorepo.

How It Works

This GitHub Action runs when an pull_request event webhook is fired in your GitHub repo. The action checks if any of the files in the pull request are in a monorepo repo (ex. /directory/... from the root of the monorepo). If one or more monorepos are found, the pull request is labeled with a label for each monorepo repo. Directories that beging with a dot (ex. /.directory/) are ignored.

Examples

Example of PR that has changes in two monorepo repos: GitHub Logo

Example of monorepo repo structure: GitHub Logo

Installation

To use this GitHub Action, you must have access to GitHub Actions. GitHub Actions are currently only available in private beta (you must apply for access) and only work in private repos.

To setup this action:

  1. Create a .github/main.workflow in your GitHub repo.
  2. Add the following code to the main.workflow file and commit it to the repo's master branch.
workflow "Monorepo PR Repo Labeler" {
  resolves = ["Label PR Monorepos"]
  on = "pull_request"
}

action "Label PR Monorepos" {
  uses = "adamzolyak/monorepo-pr-labeler-action@master"
  secrets = ["GITHUB_TOKEN"]
}
  1. Whenever you open, edit, close, etc a pull request, the action will run!

Contributing

If you have suggestions for how this GitHub Action could be improved, or want to report a bug, open an issue! Or pull request! We'd love all and any contributions. For more, check out the Contributing Guide.

License

ISC © 2018 Adam Zolyak adam@tinkurlab.com (www.tinkurlab.com)