{"id":30717212,"url":"https://github.com/addono/gitlab-fetches","last_synced_at":"2025-10-25T00:42:24.965Z","repository":{"id":310664398,"uuid":"1040729837","full_name":"Addono/gitlab-fetches","owner":"Addono","description":"CLI tool to get the amount of fetches a GitLab repository has.","archived":false,"fork":false,"pushed_at":"2025-08-19T14:49:37.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T14:49:43.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Addono.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T12:23:29.000Z","updated_at":"2025-08-19T14:49:41.000Z","dependencies_parsed_at":"2025-08-19T14:49:46.644Z","dependency_job_id":"4524fab9-d26c-4612-9618-818b265d74e1","html_url":"https://github.com/Addono/gitlab-fetches","commit_stats":null,"previous_names":["addono/gitlab-fetches"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Addono/gitlab-fetches","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fgitlab-fetches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fgitlab-fetches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fgitlab-fetches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fgitlab-fetches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Addono","download_url":"https://codeload.github.com/Addono/gitlab-fetches/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fgitlab-fetches/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273417248,"owners_count":25101812,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"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":[],"created_at":"2025-09-03T08:49:46.208Z","updated_at":"2025-10-13T17:07:55.141Z","avatar_url":"https://github.com/Addono.png","language":"JavaScript","readme":"\u003cbr /\u003e\n\u003ch1 align=\"center\"\u003egitlab-fetches\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cp align=\"center\"\u003e\n     Get historical fetch statistics for GitLab projects\n  \u003cbr/\u003e\n\n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/graphs/contributors\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/contributors/Addono/gitlab-fetches.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/network/members\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/forks/Addono/gitlab-fetches.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/stargazers\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/stars/Addono/gitlab-fetches.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/blob/master/LICENSE\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/Addono/gitlab-fetches.svg?style=flat-square\"\u003e\n  \u003c/a\u003e \n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/actions\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/Addono/gitlab-fetches/ci.yml?style=flat-square\u0026logo=github%20actions\"\u003e\n  \u003c/a\u003e \n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/releases\"\u003e\n  \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/Addono/gitlab-fetches?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/releases\"\u003e\n  \u003cimg alt=\"Script file size\" src=\"https://img.shields.io/github/size/Addono/gitlab-fetches/src/gitlab-fetches.sh?style=flat-square\u0026color=green\"\u003e\n  \u003c/a\u003e\n    \n  \u003cbr/\u003e\n  \n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/pkgs/container/gitlab-fetches\"\u003e\n    \u003cstrong\u003eView on GitHub Container Registry\u003c/strong\u003e\n  \u003c/a\u003e\n  \n  \u003cbr/\u003e\n  \u003ca href=\"https://github.com/Addono/gitlab-fetches#examples\"\u003e\u003cstrong\u003eExample usage\u003c/strong\u003e\u003c/a\u003e\n  ·\n  \u003ca href=\"https://github.com/Addono/gitlab-fetches/pulls\"\u003eSubmit a PR\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n`./src/gitlab-fetches.sh` is a script designed to fetch historical data from the GitLab API. It is [sh](https://en.wikipedia.org/wiki/Bourne_shell) and [alpine](https://alpinelinux.org/) compatible.\n\nThe easiest way to get started using this tool is to include the `src/gitlab-fetches.sh` file as part of your project. Then call this script as part of any automation script.\n\n## Usage\n\n### Locally\n\nDownload the `gitlab-fetches.sh` file from the `src` directory, either the latest from [`main`](https://raw.githubusercontent.com/Addono/gitlab-fetches/main/src/gitlab-fetches.sh) or for a specific version check out the [Releases](https://github.com/Addono/gitlab-fetches/releases)-page.\n\nWith the file locally on your file system, you can directly invoke it.\n\n```\n./src/gitlab-fetches.sh [ --token \u003ctoken\u003e ] \u003cgitlab_project_url...\u003e\n  --token \u003ctoken\u003e  GitLab API token with the `read_api` scope. Can also be set with GITLAB_TOKEN env var.\n  -h, --help       Display this help message.\n  -v, --version    Display the version number.\n```\n\n### GitHub Actions\n\nYou can use this script in a GitHub Action to gather statistics about a GitLab project:\n\n```yaml\n      - name: Fetch GitLab Stats\n        run: |\n          wget -qO- https://raw.githubusercontent.com/Addono/gitlab-fetches/main/src/gitlab-fetches.sh | \\\n          sh -s -- --token ${{ secrets.GITLAB_TOKEN }} https://gitlab.com/gitlab-org/gitlab\n```\n\n### Docker\n\nWe also publish a container to the GitHub Container Registry at [`ghcr.io/addono/gitlab-fetches`](https://github.com/Addono/gitlab-fetches/pkgs/container/gitlab-fetches). We publish under the tag `latest` what's in `main` and tags for each release. You can use the container like this:\n\n```bash\n$ docker run --rm -e GITLAB_TOKEN=$YOUR_GITLAB_TOKEN ghcr.io/addono/gitlab-fetches https://gitlab.com/gitlab-org/gitlab\n```\n\n## Examples\n\nTo get statistics for a single project:\n\n```\n$ ./src/gitlab-fetches.sh --token \"your-token\" https://gitlab.com/gitlab-org/gitlab\n{\n  \"gitlab-org/gitlab\": {\n    \"historical\": [\n      {\n        \"date\": \"2025-08-19\",\n        \"fetches\": 20\n      }\n    ],\n    \"total\": 20\n  }\n}\n```\n\nTo get statistics for multiple projects at once:\n\n```\n$ ./src/gitlab-fetches.sh --token \"your-token\" https://gitlab.com/gitlab-org/gitlab https://gitlab.com/gitlab-org/gitlab-runner\n{\n  \"gitlab-org/gitlab\": {\n    \"historical\": [\n      {\n        \"date\": \"2025-08-19\",\n        \"fetches\": 20\n      }\n    ],\n    \"total\": 20\n  },\n  \"gitlab-org/gitlab-runner\": {\n    \"historical\": [\n      {\n        \"date\": \"2025-08-19\",\n        \"fetches\": 15\n      }\n    ],\n    \"total\": 15\n  }\n}\n```\n\n## Testing\n\nTesting is done using Node.js's built-in test runner. We use it to execute the shell script and assert its behavior.\n\nFor reproducibility, we run our tests inside Docker, such that we have control over the versions of `bash`, `curl`, and `jq` we're testing against.\n\n```bash\ndocker build --target test-env --tag gitlab-fetches-test .\ndocker run --rm -t gitlab-fetches-test\n```\n\n## Contributing\n\nWhen creating PRs, please style your commit messages according to [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/), you can use a tool like [commitizen](https://github.com/commitizen/cz-cli) to guide you. We will automatically infer the changelog from your commits. Alternatively, we can squash all commits when merging and update the commit message.\n\nThis project strongly prefers maintaining backwards compatibility, therefore some obvious \"fixes\" might not be accepted.\n\nAlso, please include or update the test cases whenever possible by extending `test/test.js`.\n\n## Note\n\nMake sure `bash`, `curl`, and `jq` are installed in your environment before running the script.\n\n## License\n\nThis tool is released under the MIT license. It's derived from:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ca href=\"https://github.com/eficode/wait-for\"\u003ewait-for\u003c/a\u003e: MIT license, 2017 Eficode Oy\u003c/summary\u003e\nThe MIT License (MIT)\n\nCopyright (c) 2017 Eficode Oy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fgitlab-fetches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddono%2Fgitlab-fetches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fgitlab-fetches/lists"}