{"id":32535061,"url":"https://github.com/remal-gradle-plugins/github-repository-info","last_synced_at":"2026-05-02T11:37:52.359Z","repository":{"id":319737595,"uuid":"1079456248","full_name":"remal-gradle-plugins/github-repository-info","owner":"remal-gradle-plugins","description":"A Gradle plugin that provides functionality to access GitHub repository information directly from the build environment.","archived":false,"fork":false,"pushed_at":"2026-04-29T13:28:08.000Z","size":474,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T15:34:01.068Z","etag":null,"topics":["github","gradle","gradle-plugin","plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","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/remal-gradle-plugins.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-19T20:54:26.000Z","updated_at":"2026-04-29T13:28:14.000Z","dependencies_parsed_at":"2025-10-28T12:07:54.727Z","dependency_job_id":"542db2fc-2842-47fd-82da-1ff1d983c65e","html_url":"https://github.com/remal-gradle-plugins/github-repository-info","commit_stats":null,"previous_names":["remal-gradle-plugins/github-repo-info","remal-gradle-plugins/github-repository-info"],"tags_count":6,"template":false,"template_full_name":"remal-gradle-plugins/template","purl":"pkg:github/remal-gradle-plugins/github-repository-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remal-gradle-plugins%2Fgithub-repository-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remal-gradle-plugins%2Fgithub-repository-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remal-gradle-plugins%2Fgithub-repository-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remal-gradle-plugins%2Fgithub-repository-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remal-gradle-plugins","download_url":"https://codeload.github.com/remal-gradle-plugins/github-repository-info/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remal-gradle-plugins%2Fgithub-repository-info/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32533344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T11:28:32.350Z","status":"ssl_error","status_checked_at":"2026-05-02T11:27:30.140Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["github","gradle","gradle-plugin","plugin"],"created_at":"2025-10-28T13:01:25.131Z","updated_at":"2026-05-02T11:37:52.347Z","avatar_url":"https://github.com/remal-gradle-plugins.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Tested on Java LTS versions from \u003c!--property:java-runtime.min-version--\u003e11\u003c!--/property--\u003e to \u003c!--property:java-runtime.max-version--\u003e26\u003c!--/property--\u003e.**\n\n**Tested on Gradle versions from \u003c!--property:gradle-api.min-version--\u003e8.0\u003c!--/property--\u003e to \u003c!--property:gradle-api.max-version--\u003e9.5.0\u003c!--/property--\u003e.**\n\n# `name.remal.github-repository-info` plugin\n\n[![configuration cache: supported](https://img.shields.io/static/v1?label=configuration%20cache\u0026message=supported\u0026color=success)](https://docs.gradle.org/current/userguide/configuration_cache.html)\n\n\u003c!--plugin-usage:name.remal.github-repository-info--\u003e\n```groovy\nplugins {\n    id 'name.remal.github-repository-info' version '1.0.2'\n}\n```\n\u003c!--/plugin-usage--\u003e\n\n\u0026nbsp;\n\nThis Gradle plugin that provides functionality to access GitHub repository information\ndirectly from the build environment.\n\nIt can be useful for projects that need to load some GitHub repository information dynamically.\nThis is how you can add Maven POM license using this plugin:\n\n```groovy\napply plugin: 'maven-publish'\n\npublishing.publications.withType(MavenPublication).configureEach {\n  pom {\n    licenses {\n      license {\n        name = githubRepositoryInfo.licenseFile.map { it.license.name }\n        url = githubRepositoryInfo.licenseFile.map { it.htmlUrl }\n      }\n    }\n  }\n}\n```\n\nAll the information is loaded lazily and cached during the build.\n\n## `githubRepositoryInfo` extension\n\nThis plugin creates `githubRepositoryInfo` extension that provides the following\n[read-only](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/HasConfigurableValue.html#disallowChanges())\n[properties](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html).\n\n* `githubRepositoryInfo.repository` - provides information about the repository itself ([example](https://api.github.com/repos/remal-gradle-plugins/github-repository-info))\n* `githubRepositoryInfo.licenseFile` - provides information about the repository license file ([example](https://api.github.com/repos/remal-gradle-plugins/github-repository-info/license))\n* `githubRepositoryInfo.contributors` - provides a list of repository contributors ([example](https://api.github.com/repos/remal-gradle-plugins/github-repository-info/contributors))\n* `githubRepositoryInfo.languages` - provides a map of programming languages used in the repository with their byte size ([example](https://api.github.com/repos/remal-gradle-plugins/github-repository-info/languages))\n\nAll these properties load data lazily\nand **cache the result** in `./build/tmp/.cache/name.remal.github-repository-info` directory.\nTo get updated data, you need to delete this cache directory.\n\nAlso, you can get or configure general GitHub connection settings via the following `Property\u003cString\u003e` properties.\nThese properties are automatically configured from GitHub Actions environment variables or remote URL in the `.git/config` file.\n\n* `githubRepositoryInfo.githubApiUrl` - GitHub API URL (default: `https://api.github.com`).\n* `githubRepositoryInfo.repositoryFullName` - repository full name (e.g., `owner/repo`).\n* `githubRepositoryInfo.githubApiToken` - GitHub API authentication token.\n  See the [Configuration](#configuration) section.\n* `githubRepositoryInfo.githubServerUrl` - GitHub URL (default: `https://github.com`).\n  Not used by this plugin directly, but can be useful for constructing links.\n\n\u003c!--\n## Loading data via `RetrieveGitHubRepository*Info` tasks\n\nYou can register tasks to retrieve GitHub repository information explicitly.\n\nAll these tasks emit a JSON file with the retrieved data. This data can be deserialized using the `GitHubJsonDeserializer` class.\n\nThese tasks do **not** override the result JSON file, so to get an updated result, you need to delete the previous result file.\n\n```groovy\nimport static name.remal.gradle_plugins.github_repository_info.GitHubJsonDeserializer.deserializerGitHubRepositoryContributorsInfo\nimport static name.remal.gradle_plugins.github_repository_info.GitHubJsonDeserializer.deserializerGitHubRepositoryInfo\nimport static name.remal.gradle_plugins.github_repository_info.GitHubJsonDeserializer.deserializerGitHubRepositoryLanguagesInfo\nimport static name.remal.gradle_plugins.github_repository_info.GitHubJsonDeserializer.deserializerGitHubRepositoryLicenseFileInfo\n\nimport name.remal.gradle_plugins.github_repository_info.RetrieveGitHubRepositoryContributorsInfo\nimport name.remal.gradle_plugins.github_repository_info.RetrieveGitHubRepositoryInfo\nimport name.remal.gradle_plugins.github_repository_info.RetrieveGitHubRepositoryLanguagesInfo\nimport name.remal.gradle_plugins.github_repository_info.RetrieveGitHubRepositoryLicenseFileInfo\nimport name.remal.gradle_plugins.github_repository_info.info.GitHubContributor\nimport name.remal.gradle_plugins.github_repository_info.info.GitHubFullRepository\nimport name.remal.gradle_plugins.github_repository_info.info.GitHubLicenseContent\n\ndef repositoryInfoTask = tasks.register('repositoryInfo', RetrieveGitHubRepositoryInfo) { // provides information about the repository itself\n  outputJsonFile = file('...')\n}\n\nProvider\u003cGitHubFullRepository\u003e repositoryInfo = repositoryInfoTask.flatMap { it.outputJsonFile }.map { deserializerGitHubRepositoryInfo(it) }\n\n\ndef repositoryLicenseFileInfoTask = tasks.register('repositoryLicenseFileInfo', RetrieveGitHubRepositoryLicenseFileInfo) { // provides information about the repository license file\n  outputJsonFile = file('...')\n}\n\nProvider\u003cGitHubLicenseContent\u003e repositoryLicenseFileInfo = repositoryLicenseFileInfoTask.flatMap { it.outputJsonFile }.map { deserializerGitHubRepositoryLicenseFileInfo(it) }\n\n\ndef repositoryContributorsInfoTask = tasks.register('repositoryContributorsInfo', RetrieveGitHubRepositoryContributorsInfo) { // provides information about the repository contributors\n  outputJsonFile = file('...')\n}\n\nProvider\u003cList\u003cGitHubContributor\u003e\u003e repositoryContributorsInfo = repositoryContributorsInfoTask.flatMap { it.outputJsonFile }.map { deserializerGitHubRepositoryContributorsInfo(it) }\n\n\ndef repositoryLanguagesInfoTask = tasks.register('repositoryLanguagesInfo', RetrieveGitHubRepositoryLanguagesInfo) { // provides a map of programming languages used in the repository with their byte size\n  outputJsonFile = file('...')\n}\n\nProvider\u003cMap\u003cString, Integer\u003e\u003e repositoryLanguagesInfo = repositoryLanguagesInfoTask.flatMap { it.outputJsonFile }.map { deserializerGitHubRepositoryLanguagesInfo(it) }\n```\n--\u003e\n\n## Configuration\n\n**For public GitHub repositories, the plugin should work without any additional configuration.**\n\nHowever, for **private** repositories or to **increase the rate limits**, you need to provide a GitHub token.\n\nTo configure a GitHub token for GitHub Actions,\nset `GITHUB_TOKEN` environment variable for your GitHub Actions job:\n\n```yaml\n- name: Run Gradle build\n  env:\n    GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}\n  run: ./gradlew build\n```\n\n`GITHUB_ACTIONS_TOKEN` environment variable can be used instead of `GITHUB_TOKEN`.\n\nTo configure a GitHub token for local development,\nadd `name.remal.github-repository-info.api-token` property to your `~/.gradle/gradle.properties` file:\n\n```properties\nname.remal.github-repository-info.api-token = \u003cyour github token here\u003e\n```\n\nThis file is in [the Gradle User Home directory](https://docs.gradle.org/current/userguide/directory_layout.html#dir:gradle_user_home),\nso it won't be committed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremal-gradle-plugins%2Fgithub-repository-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremal-gradle-plugins%2Fgithub-repository-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremal-gradle-plugins%2Fgithub-repository-info/lists"}