{"id":16688543,"url":"https://github.com/hoijui/is-git-forge-public","last_synced_at":"2026-04-06T08:31:21.999Z","repository":{"id":243881027,"uuid":"621980076","full_name":"hoijui/is-git-forge-public","owner":"hoijui","description":"Figures out whether a git repo is public, given its WebUI URL.","archived":false,"fork":false,"pushed_at":"2023-04-21T18:09:57.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-29T02:13:31.688Z","etag":null,"topics":["cli","git","gitea","github","gitlab","sourcehut"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hoijui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T20:12:46.000Z","updated_at":"2023-04-04T15:31:16.000Z","dependencies_parsed_at":"2024-06-11T19:56:56.444Z","dependency_job_id":"1a885581-e76a-4351-bac7-220f7d4bc452","html_url":"https://github.com/hoijui/is-git-forge-public","commit_stats":null,"previous_names":["hoijui/is-git-forge-public"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hoijui/is-git-forge-public","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fis-git-forge-public","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fis-git-forge-public/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fis-git-forge-public/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fis-git-forge-public/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoijui","download_url":"https://codeload.github.com/hoijui/is-git-forge-public/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fis-git-forge-public/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31464604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","git","gitea","github","gitlab","sourcehut"],"created_at":"2024-10-12T15:44:06.046Z","updated_at":"2026-04-06T08:31:21.980Z","avatar_url":"https://github.com/hoijui.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2023 Robin Vobruba \u003choijui.quaero@gmail.com\u003e\nSPDX-License-Identifier: CC0-1.0\n--\u003e\n\n# is-git-forge-public\n\n[![License: AGPL-3.0-or-later](\n    https://img.shields.io/badge/License-AGPL%203.0+-blue.svg)](\n    https://www.gnu.org/licenses/agpl-3.0.html)\n[![REUSE status](\n    https://api.reuse.software/badge/github.com/hoijui/is-git-forge-public)](\n    https://api.reuse.software/info/github.com/hoijui/is-git-forge-public)\n\n[![In cooperation with FabCity Hamburg](\n    https://custom-icon-badges.demolab.com/badge/-FCHH-dddddd.svg?logo=fc_logo)](\n    https://fabcity.hamburg)\n[![In cooperation with Open Source Ecology Germany](\n    https://custom-icon-badges.demolab.com/badge/-OSEG-555555.svg?logo=oseg_logo)](\n    https://opensourceecology.de)\n\n## What is this\n\nGiven the URL to a git repository on a known forge site -\nor at least using a known forge software -\nreturns whether the project is public or not.\nNon-public could be private, internal, unlisted, bad URL,\nnon repository URL, or possibly something else.\n\nIt does that by downloading the HTML of the Web-UI of the repository,\nfrom which it then extracts the necessary info.\nThis info is then presenting it in a uniform way,\nindependent of the forge site, the software it is running,\nand the actual findings of the evaluation.\n\nWhy this way, instead of using API(s)? \\\nThis is much simpler, using a uniform technique for any URL given.\nA simple script, easily extendable to other sites,\nrequiring no tokens or anything else for authentication.\nThe downside of course, is that it might be less robust over time,\nand that it will likely not fail-fast.\n\nWe try to mitigate that downside,\nby running unit tests once a week.\n\nSupported sites/forge software:\n\n* [GitHub](https://github.com)\n* [GitLab](https://gitlab.com)\n* [Gitea](https://gitea.io/)\n* [SourceHut](https://sourcehut.org/)\n\n## Usage\n\n```shell-sh\n$ is-git-forge-public --help\n\nUsage:\n  is-git-forge-public [OPTION...] \u003cREPO-WEB-URL\u003e\nOptions:\n  -h, --help              Print this usage help and exits.\n  -f, --fail              Return failure if download returned status 404.\n                          While that might indicate a bad URL,\n                          it is also the case when trying to access\n                          a private repo without authentication.\n  -c, --check [FORGE]     Instead of using the checks for all forges,\n                          use only a specific one.\n                          Supported: 'github', 'gitlab', 'gitea', 'sourcehut'\nExamples:\n  is-git-forge-public --help\n  is-git-forge-public \"https://github.com/user/repo\"\n  is-git-forge-public --check github \"https://github.com/user/repo\"\n```\n\n## Examples\n\nPublic repo:\n\n```shell-sh\n$ is-git-forge-public \"https://github.com/hoijui/MeditationBench\"\ntrue\npublic\n```\n\nPrivate repo:\n\n```shell-sh\n$ is-git-forge-public \"https://github.com/hoijui/tst-private\"\nWARN: Failed fetching the HTML content of URL:\nWARN: 'https://github.com/hoijui/tst-private'\nWARN: This could be due to:\nWARN: - private repo URL\nWARN: - not a repo URL\nWARN: - no internet access\nWARN: - authentication required\nWARN: - mistyped repo URL\nWARN: - ...\nfalse\nunknown\n```\n\nIn this second example,\nall the `WARN: ...` lines go to `stderr`.\nThis is where all logging goes\n(in alignment with [CLI best-practice](https://clig.dev/#the-basics)),\nso that on `stdout`, we only ever get these two lines of output:\n\n| Line Number | Name | Machine-Readable | Type | Valid Values (regex) | Example |\n| - | ----- | -- | --- | --- | --- |\n| 1 | Is Public? | yes | boolean | `true|false` | `false` |\n| 2 | State | no | string | `.*` | `unknown` |\n\nIn most cases, this script is probably going to be used by other software,\nin which case, you are probably only interested in the first line of `stdout`,\nwhich in BASH you might use like this:\n\n```bash\nrepo_url=\"https://github.com/hoijui/MeditationBench\"\n#repo_url=\"https://github.com/hoijui/tst-private\"\n\nis_public=\"$(is-git-forge-public \"$repo_url\" 2\u003e /dev/null | head -n 1)\"\n\nif $is-git-forge-public\nthen\n    echo \"Git repo '$repo_url' is public!\"\nelse\n    echo \"Git repo '$repo_url' is *not* public!\"\nfi\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoijui%2Fis-git-forge-public","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoijui%2Fis-git-forge-public","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoijui%2Fis-git-forge-public/lists"}