csi-lk / package-labeler

Github action to dynamically label pull requests affecting packages in a monorepo / workspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

package-labeler

Github action to dynamically label pull requests affecting packages in a monorepo / workspace

Usage

name: Workspace Package Labeler
on: [pull_request]

jobs:
  label:
    runs-on: ubuntu-latest
    steps:
      - uses: csi-lk/package-labeler
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"
          workspace: "packages" # (default)
          name: "folder" # (default) / 'package.json'
          prefix: "pkg: "

If any pull request code changes match ./packages/**/* they will be labeled per decendent folder with prefix of pkg:

For example if I have a folder structure of

packages/
    core/
        core.js
    tools/
        tools.js

And I make a code change to core.js the PR will be labelled with pkg: core

Example

csi-lk/test-labeler#1

You can see the changed files and how the github-actions bot as added the labels to the PR


Work inspired by the actions/labeler project from Github

About

Github action to dynamically label pull requests affecting packages in a monorepo / workspace

License:MIT License


Languages

Language:TypeScript 100.0%