Skip to content

Sync labels to all org repositories #3

Sync labels to all org repositories

Sync labels to all org repositories #3

Workflow file for this run

name: Sync labels to all org repositories
on:
workflow_dispatch:
push:
paths:
- "/labels.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:
contents: 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 }}