Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync labels on multiple repositories at once #49

Closed
slawekjaranowski opened this issue Oct 28, 2020 · 7 comments · Fixed by #58
Closed

Sync labels on multiple repositories at once #49

slawekjaranowski opened this issue Oct 28, 2020 · 7 comments · Fixed by #58

Comments

@slawekjaranowski
Copy link
Contributor

In many case I want to sync labels on multiple repositories.
No I can set repository for action, but only one.

My proposition to support syntax like:

- uses: micnncim/action-label-syncer@v1
        with:
          repository: |
              myother/repository,
              myother/second-repository;
              myother/next-repository

we can split repositories name by new line, comma, semicolon

@micnncim
Copy link
Owner

Could you try to use matrix? See also: #45

@slawekjaranowski
Copy link
Contributor Author

ok, matrix can be some workaround until we reach limits for github action:
https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration#usage-limits
It also be cheaper when someone will use in private repo - one job consume less minute.

In my opinion support multiple repos by action will be more effective we will need one job for work.

So implementation it is not difficult - I can prepare next PR, but I need my previous PR.

@slawekjaranowski
Copy link
Contributor Author

Example configuration with matrix:

jobs:
  labels_sync:
    strategy:
      # don't break another job if one is failed
      fail-fast: false
      matrix:
        repo:
          - user/repo1
          - user/repo2
          - user/repo3

    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/[email protected]

      - name: Sync
        uses: micnncim/[email protected]
        with:
          repository: ${{ matrix.repo }}
          token: ${{ secrets.TOKEN }}
          prune: false

@davidxjohnson
Copy link

One of the reasons for wanting a multi-repo sync is if the repos all share a project board. This makes the shared project board more consistent with its use of standardized labels. As you probably know, the labels belong to the repo, not the project.

The matrix approach is compelling, other than the draw-back of kicking off a potentially large number of jobs.

The code does not appear to support multiple repos; just one repo. The fix would be pretty simple with some minor mods to main.go to accept a list of 1 or more repos.

If nobody else is working on that, I'd be happy to submit a pull-request.

@micnncim
Copy link
Owner

Sorry for being late 🙇 I've added the support of multiple repositories and released v1.3.0. It's also available with v1.

@jdbruijn
Copy link

Does anybody actually have this working? I have the following configuration but only repo-a is being processed.

- name: Synchronise GitHub labels
  uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
  with:
    manifest: .github/labels.yml
    prune: false
    token: ${{ steps.generate_token.outputs.token }}
    repository: |
        me/repo-a
        me/repo-b

@jdbruijn
Copy link

My bad, actually works but the token didn't have the appropriate permissions and I didn't see that because of #62. Multiple repositories from input now works as expected!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants