{"id":20996005,"url":"https://github.com/jimmygchen/runner-fallback-action","last_synced_at":"2025-05-14T21:31:48.107Z","repository":{"id":190405811,"uuid":"682525963","full_name":"jimmygchen/runner-fallback-action","owner":"jimmygchen","description":"Github action to determine the availability of self-hosted runners","archived":false,"fork":false,"pushed_at":"2024-07-09T21:10:08.000Z","size":291,"stargazers_count":22,"open_issues_count":6,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-11T12:17:00.648Z","etag":null,"topics":["ci","github-actions","github-runners","github-workflows","self-hosted-runners"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jimmygchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-24T11:10:29.000Z","updated_at":"2025-02-12T00:09:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"deea8498-4324-4aec-af3f-8f915d116ff5","html_url":"https://github.com/jimmygchen/runner-fallback-action","commit_stats":null,"previous_names":["jimmygchen/runner-fallback-action"],"tags_count":2,"template":false,"template_full_name":"actions/javascript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmygchen%2Frunner-fallback-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmygchen%2Frunner-fallback-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmygchen%2Frunner-fallback-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmygchen%2Frunner-fallback-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimmygchen","download_url":"https://codeload.github.com/jimmygchen/runner-fallback-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254231032,"owners_count":22036282,"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":["ci","github-actions","github-runners","github-workflows","self-hosted-runners"],"created_at":"2024-11-19T07:27:22.180Z","updated_at":"2025-05-14T21:31:46.054Z","avatar_url":"https://github.com/jimmygchen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github Runner Fallback Action\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jimmygchen/runner-fallback-action/actions\"\u003e\u003cimg alt=\"javscript-action status\" src=\"https://github.com/jimmygchen/runner-fallback-action/workflows/units-test/badge.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nGithub action to determine the availability of self-hosted runners, and fallback to a GitHub runner if the primary runners are offline.\n\nThis action uses [GitHub API](https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository) to check the statuses of self hosted-runners that match specific labels, and outputs the runner label(s), or a fallback runner if the self-hosted runner(s) is unavailable.\n\nThis output can then used on the `runs-on` property of subsequent jobs. \n\nNote: In order to support an array of labels for the `runs-on` field, the output is formatted as a JSON string and needs to be parsed using `fromJson`. See example usage below.\n\n## Usage\n\n```yaml\njobs:\n  # Job to \n  determine-runner:\n    runs-on: ubuntu-latest\n    outputs:\n      runner: ${{ steps.set-runner.outputs.use-runner }}\n    steps:\n      - name: Determine which runner to use\n        id: set-runner\n        uses: jimmygchen/runner-fallback-action@v1\n        with:\n          primary-runner: \"self-hosted,linux\"\n          fallback-runner: \"ubuntu-latest\"\n          github-token: ${{ secrets.YOUR_GITHUB_TOKEN }}\n\n  another-job:\n    needs: determine-runner\n    runs-on: ${{ fromJson(needs.determine-runner.outputs.runner) }}\n    steps:\n      - name: Do something\n        run: echo \"Doing something on ${{ needs.determine-runner.outputs.runner }}\"\n```\n\nCredit: this action is based on the pattern described by @ianpurton on [this feature request thread](https://github.com/orgs/community/discussions/20019#discussioncomment-5414593).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmygchen%2Frunner-fallback-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimmygchen%2Frunner-fallback-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmygchen%2Frunner-fallback-action/lists"}