Skip to content

Get Organization Repository Names

Actions
Get all an organization s repository names to do matrix builds
v3.1
Latest
Star (8)

Get Organization's Repositories

This is an Action to get all an organization's repositories by name.

The primary use case is for repeating a task for all the repositories in an organization.

⚠️ A job matrix can generate a maximum of 256 jobs per workflow run ⚠️

Default Workflow

name: Hello World

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  get-org-repos:
    runs-on: ubuntu-latest
    steps:
      - uses: austenstone/get-org-repos@main
        with:
          github-token: ${{ secrets.TOKEN }}
        id: get-org-repos
    outputs:
      repos: ${{ steps.get-org-repos.outputs.repos }}

  print:
    runs-on: ubuntu-latest
    needs: [get-org-repos]
    strategy:
      matrix:
        repo: ${{ fromJson(needs.get-org-repos.outputs.repos) }}
      fail-fast: false
    steps:
      - run: echo "Hello ${{ matrix.repo }}!"

Deliminate String Workflow

name: Hello World

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  get-org-repos:
    runs-on: ubuntu-latest
    steps:
      - uses: austenstone/get-org-repos@main
        with:
          github-token: ${{ secrets.TOKEN }}
          delimiter: '\n'
        id: get-org-repos
      - run: echo -e "${{ steps.get-org-repos.outputs.repos }}" > repos.txt
      - run: cat repos.txt

Git Workflow

name: Sync Repositories

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  get-org-repos:
    runs-on: ubuntu-latest
    steps:
      - uses: austenstone/get-org-repos@main
        with:
          github-token: ${{ secrets.TOKEN }}
        id: get-org-repos
    outputs:
      repos: ${{ steps.get-org-repos.outputs.repos }}

  sync:
    needs:
      - get-org-repos
    runs-on: ubuntu-latest
    strategy:
      matrix:
        repo: ${{ fromJson(needs.get-org-repos.outputs.repos) }}
      fail-fast: false
    steps:
      - uses: actions/checkout@v3
        with:
          repository: ${{ github.event.organization.login }}/${{ matrix.repo }}
          token: ${{ secrets.TOKEN }}
      - run: ls -al

➡️ Input Settings

Various inputs are defined in action.yml:

Name Description Default
github‑token Token to use to authorize. ${{ github.token }}
org The organization name. ${{ github.event.organization.login }}
delimiter The delimiter to use when joining the names. N/A

Further help

To get more help on the Actions see documentation.

Get Organization Repository Names is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Get all an organization s repository names to do matrix builds
v3.1
Latest

Get Organization Repository Names is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.