Giter VIP home page Giter VIP logo

package-labeler's Introduction

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

package-labeler's People

Contributors

csi-lk avatar jrson83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

package-labeler's Issues

Multiple issues. Are pull requests still accepted?

The labeler is exactly what I need, but I'm having multiple issues with it.

  1. Unexpected input(s) 'name', valid inputs are ['repo-token', 'workspace', 'prefix']

It seems that the parameter name does not exist at all.

  1. Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: csi-lk/[email protected]

The action.yml node version should be updated from node12 to node16.

  1. The deps should be updated.

When updating the deps, code modification is required. Should switch to package @octokit/rest and use:

import { Octokit } from '@octokit/rest';

const client = new Octokit({
  auth: token
});
  1. The docs describe how to use prefix: "pkg: ". There is a space behind the colon, so the applied tag should be pkg: core. However the space gets trimmed from the prefix and the applied tag is pkg:core without space..

Are pull requests still accepted? If so, I would really like to contribute to fix the issues. As an alternative I would fork the repo, apply the patches and release a new workflow. I would prefer the first one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.