pratikmallya / autolabeler-codeowners

✨🏷️ Github Action to add labels to PRs based on CODEOWNERS
MIT License
8 stars 8 forks source link
codeowners github-actions

.. image:: https://github.com/pratikmallya/autolabeler-codeowners/workflows/build-test/badge.svg?branch=master

autolabeler-codeowners

Adds labels to PR's based on CODEOWNERS. Useful in monorepos where there can be a ton of concurrent users and it might get hard to find the relevant PR for a particular team.

Example usage

The following is a fully functional Github Workflow. Note that a Github Oauth token needs to be added to the Github repo as a Github secret with the name githubToken.

.. code:: yaml

on: [pull_request] jobs: autolabeler-codeowners: runs-on: ubuntu-latest name: PR + CODEOWNERS Workflows steps:

.. _Github secret: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets .. _Github Workflow: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow

Deployment

The nodejs modules (in ./node_modules) and compiled JS (in ./lib) must be committed to the release branches but NOT to master (to keep master branch clean)

Testing

Known Limitations

.. _Github promises to fix this by GA: https://github.community/t5/GitHub-Actions/Github-Workflow-not-running-from-pull-request-from-forked/m-p/33484/highlight/true#M1524

Release Process

(TODO: automate)

.. _Github Marketplace: https://github.com/marketplace/actions/autolabeler-codeowners