Skip to content

Sync labels to all org repositories #6

Sync labels to all org repositories

Sync labels to all org repositories #6

Workflow file for this run

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 }}