{"id":26802391,"url":"https://github.com/raven-actions/get-repos","last_synced_at":"2025-04-23T02:36:52.051Z","repository":{"id":163246568,"uuid":"638000528","full_name":"raven-actions/get-repos","owner":"raven-actions","description":"🗄️ Get organization or user repos based on the topics filter (with logic AND/OR) to use in the matrix job or another action.","archived":false,"fork":false,"pushed_at":"2023-11-14T19:47:07.000Z","size":32,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-29T21:17:50.178Z","etag":null,"topics":["action","actions","composite-action","github-action","github-actions","raven-actions"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/get-repositories","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raven-actions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null}},"created_at":"2023-05-08T21:47:40.000Z","updated_at":"2025-01-25T07:14:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbe6830b-2acf-46d0-8f97-adecb8b7df4d","html_url":"https://github.com/raven-actions/get-repos","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raven-actions%2Fget-repos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raven-actions%2Fget-repos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raven-actions%2Fget-repos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raven-actions%2Fget-repos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raven-actions","download_url":"https://codeload.github.com/raven-actions/get-repos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250358941,"owners_count":21417575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","actions","composite-action","github-action","github-actions","raven-actions"],"created_at":"2025-03-29T21:17:55.867Z","updated_at":"2025-04-23T02:36:52.035Z","avatar_url":"https://github.com/raven-actions.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗄️ Get Repositories Action\n\n[![GitHub - marketplace](https://img.shields.io/badge/marketplace-get--repositories-blue?logo=github\u0026style=flat-square)](https://github.com/marketplace/actions/get-repositories)\n[![GitHub - release](https://img.shields.io/github/v/release/raven-actions/get-repos?style=flat-square)](https://github.com/raven-actions/get-repos/releases/latest)\n[![GitHub - ci](https://img.shields.io/github/actions/workflow/status/raven-actions/get-repos/ci.yml?logo=github\u0026label=CI\u0026style=flat-square\u0026branch=main\u0026event=push)](https://github.com/raven-actions/get-repos/actions/workflows/ci.yml?query=branch%3Amain+event%3Apush)\n[![GitHub - license](https://img.shields.io/github/license/raven-actions/get-repos?style=flat-square)](https://github.com/raven-actions/get-repos/blob/main/LICENSE)\n\nThis [GitHub Action](https://github.com/features/actions) provides a list of repositories associated with a provided organization or user, with the option to include specific topics related to the repositories.\n\nThe primary purpose is to repeat a task for all repositories in an organization using the [GitHub Actions matrix](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) feature. It's the default behavior with `json` array output.\n\n\u003e ⚠️ With a job matrix, creating a maximum of **256** jobs per workflow run is possible!\n\nYou can also use this action to get a **flat** output with your delimiter for different purposes than the matrix job. Read more in the [Flat output](#flat-output) section.\n\n## 📃 Table of Contents \u003c!-- omit in toc --\u003e\n\n- [🤔 Usage](#-usage)\n  - [Quick Start](#quick-start)\n  - [Flat output](#flat-output)\n- [📥 Inputs](#-inputs)\n- [📤 Outputs](#-outputs)\n  - [Example JSON output](#example-json-output)\n  - [Example FLAT output](#example-flat-output)\n- [👥 Contributing](#-contributing)\n- [📄 License](#-license)\n\n## 🤔 Usage\n\n### Quick Start\n\nExample GitHub Workflow, to get all repositories that contain **ANY** of listed topics (`OR` operator is by default). Follow [📥 Inputs](#-inputs) to adjust behavior to `AND`. Then the result will be: get all repos with **ALL** listed topics.\n\n```yaml\nname: Sync Repositories\n\non:\n  schedule:\n    - cron: \"30 6 * * *\"\n\njobs:\n  get-repos:\n    name: Get Repos\n    runs-on: ubuntu-latest\n    outputs:\n      repos: ${{ steps.get-repos.outputs.repos }}\n    steps:\n      - name: Get Repositories Action\n        id: get-repos\n        uses: raven-actions/get-repos@v1\n        with:\n          topics: \"sync,docs,managed\"\n\n  sync-repos:\n    name: Sync (${{ matrix.repo.name }})\n    if: ${{ needs.get-repos.outputs.repos != '[]' }} # make sure repos exist\n    runs-on: ubuntu-latest\n    needs:\n      - get-repos\n    strategy:\n      matrix:\n        repo: ${{ fromJson(needs.get-repos.outputs.repos) }}\n      fail-fast: false\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n        with:\n          repository: ${{ matrix.repo.full_name }}\n\n      # rest of your workflow steps...\n```\n\n### Flat output\n\n```yaml\n- name: Get Repositories Action (flat)\n  id: get-repos\n  uses: raven-actions/get-repos@v1\n  with:\n    topics: \"raven-actions,composite-action\"\n    operator: AND  # logic operator for topics match, AND returns repos that have all of provided topics, OR is default\n    format: flat\n    delimiter: \",\"  # default one is '\\n'\n\n- name: Repos\n  run: |\n    echo \"Total count: ${COUNT}\"\n    echo \"Format: ${FORMAT}\"\n    echo \"Repos:\"\n    echo \"${REPOS}\"\n  env:\n    REPOS: ${{ steps.get-repos.outputs.repos }}\n    COUNT: ${{ steps.get-repos.outputs.count }}\n    FORMAT: ${{ steps.get-repos.outputs.format }}\n```\n\n## 📥 Inputs\n\n|      Name      | Required |   Type   |       Default value       | Description                                                                                         |\n|:--------------:|:--------:|:--------:|:-------------------------:|-----------------------------------------------------------------------------------------------------|\n|    `owner`     |  false   | `string` | `github.repository_owner` | The organization or user name                                                                       |\n|    `topics`    |  false   | `string` |         _not set_         | Comma-separated list of repository topics                                                           |\n|   `operator`   |  false   | `string` |           `OR`            | Logic operator to use when filtering repositories by topics, `OR` or `AND`                          |\n|  `matrix-use`  |  false   |  `bool`  |          `true`           | Output to be used in matrix job? It just checks that the returned query has not exceeded 256 repos  |\n|    `format`    |  false   | `string` |          `json`           | Output format, `json` or `flat`, default to `json`                                                  |\n|  `delimiter`   |  false   | `string` |           `\\n`            | Delimiter to use when `format` is `flat`, default to `\\n`                                           |\n| `github-token` |  false   | `string` |      `github.token`       | GitHub Token with `repo` scope. Be aware results are always limited to permissions of GitHub tokens |\n\n## 📤 Outputs\n\n|   Name   |      Type       | Description                                                                                     |\n|:--------:|:---------------:|-------------------------------------------------------------------------------------------------|\n| `repos`  | `json / string` | Repositories (JSON array object if format is set to `json` / string if format is set to `flat`) |\n| `count`  |      `int`      | Number of found repositories                                                                    |\n| `format` |    `string`     | Output format                                                                                   |\n\n### Example JSON output\n\nEach of the keys you can use in your matrix job.\n\n```json\n[\n  {\n    \"owner\": \"raven-actions\",\n    \"name\": \"debug\",\n    \"full_name\": \"raven-actions/debug\",\n    \"private\": false,\n    \"html_url\": \"https://github.com/raven-actions/debug\",\n    \"fork\": false,\n    \"archived\": false,\n    \"disabled\": false,\n    \"is_template\": false,\n    \"visibility\": \"public\",\n    \"default_branch\": \"main\"\n  },\n  {\n    \"owner\": \"raven-actions\",\n    \"name\": \"actionlint\",\n    \"full_name\": \"raven-actions/actionlint\",\n    \"private\": false,\n    \"html_url\": \"https://github.com/raven-actions/actionlint\",\n    \"fork\": false,\n    \"archived\": false,\n    \"disabled\": false,\n    \"is_template\": false,\n    \"visibility\": \"public\",\n    \"default_branch\": \"main\"\n  }\n]\n```\n\n### Example FLAT output\n\nThe flat output with the custom delimiter `,`:\n\n```text\nraven-actions/debug,raven-actions/actionlint\n```\n\n\u003e Flat output returns always full name! `owner/repo`\n\n## 👥 Contributing\n\nContributions to the project are welcome! Please follow [Contributing Guide](https://github.com/raven-actions/get-repos/blob/main/.github/CONTRIBUTING.md).\n\n## 📄 License\n\nThis project is distributed under the terms of the [MIT](https://github.com/raven-actions/get-repos/blob/main/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraven-actions%2Fget-repos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraven-actions%2Fget-repos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraven-actions%2Fget-repos/lists"}