.. image:: https://github.com/pratikmallya/autolabeler-codeowners/workflows/build-test/badge.svg?branch=master
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.
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
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)
npm install --save-dev
npm run test
Github promises to fix this by GA
_.. _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
(TODO: automate)
checkout to the release branch e.g. git checkout -b releases/v1
a. If release branch already exists, git checkout releases/v1
and then
pull in any new changes you need e.g. git merge master
uncomment ./node_modules
and ./lib
from .gitignore
, this allows us
to commit them
run npm prune --production
to prune the modules
compile JS with npm run build
git add lib/
to add any newly generated JS files
commit to branch git commit -am "ADD: readying for release"
push branch
update Github Marketplace
_
.. _Github Marketplace: https://github.com/marketplace/actions/autolabeler-codeowners