crazy-max / ghaction-github-labeler

GitHub Action to manage labels on GitHub
https://github.com/marketplace/actions/github-labeler
MIT License
143 stars 17 forks source link

Support multiple config files #123

Open jvalkeal opened 3 years ago

jvalkeal commented 3 years ago

While trying to label things in multiple repos where most labels are "shared" but there's always repo specific labels it'd be nice if you could point to multiple yml files instead of just one. Action could then merge those together. If want to force all labels to come from this action I'd need to either keep single yml(and merge manually) or keep a bit crazy list of excludes.

This basically shows the annoying thing if trying to use multiple steps:

jobs:
  labeler:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Shared Labels
        uses: crazy-max/ghaction-github-labeler@v3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          yaml-file: .github/shared-labels.yml
          skip-delete: false
          dry-run: false
      - name: Project Labels
        uses: crazy-max/ghaction-github-labeler@v3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          yaml-file: .github/project-labels.yml
          skip-delete: false
          dry-run: false

As then you just end up with project labels.

Either expand existing yaml-file to use same format as exclude or make a new config key:

with:
  yaml-file: |
    .github/labels-1.yml
    .github/labels-2.yml

I might even find some time to help on this.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kdeldycke commented 2 years ago

I managed to to this with julb/action-manage-label, but unfortunately the latter has less features than ghaction-github-labeler and has some issues (fixed in https://github.com/julb/action-manage-label/pull/1).

adiroiban commented 2 years ago

One idea for multiple config files... since we have a simple yaml file here.

Keep your multiple files in the repo.

Before calling this action do a concatenation of the files. Then run the action with the concatenated yaml file as the source.