Sync labels to all org repositories #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync labels to all org repositories | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- labels.yml | |
- label.yml | |
jobs: | |
get-repos: | |
name: Get Repos | |
runs-on: ubuntu-latest | |
outputs: | |
repos: ${{ steps.get-repos.outputs.repos }} | |
steps: | |
- name: Get Repositories Action | |
id: get-repos | |
uses: raven-actions/get-repos@v1 | |
sync-labels: | |
name: Sync labels for ${{ matrix.repo.name }} | |
if: ${{ needs.get-repos.outputs.repos != '[]' }} # make sure repos exist | |
runs-on: ubuntu-latest | |
needs: | |
- get-repos | |
strategy: | |
matrix: | |
repo: ${{ fromJson(needs.get-repos.outputs.repos) }} | |
fail-fast: false | |
permissions: | |
issues: write | |
pull-requests: write | |
repository-projects: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
# https://github.com/Financial-Times/github-label-sync | |
- run: | | |
npm i -g github-label-sync | |
github-label-sync -l ./labels.yml "$LABEL_REPOSITORY" | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
LABEL_REPOSITORY: ${{ matrix.repo.full_name }} |