{"id":16494780,"url":"https://github.com/vierbergenlars/ci-detect-gradle-plugin","last_synced_at":"2025-03-23T13:31:32.560Z","repository":{"id":38209139,"uuid":"200356139","full_name":"vierbergenlars/ci-detect-gradle-plugin","owner":"vierbergenlars","description":":robot: A gradle plugin that checks if it is running on a continuous integration server and gives you access to the build metadata.","archived":false,"fork":false,"pushed_at":"2023-06-13T04:56:45.000Z","size":189,"stargazers_count":15,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T20:40:49.667Z","etag":null,"topics":["continuous-integration","gradle","gradle-plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vierbergenlars.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}},"created_at":"2019-08-03T09:18:29.000Z","updated_at":"2023-04-11T15:26:43.000Z","dependencies_parsed_at":"2024-10-28T16:11:35.144Z","dependency_job_id":"eae05c2d-c1b2-4812-b36c-0ec43dbe8c0a","html_url":"https://github.com/vierbergenlars/ci-detect-gradle-plugin","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vierbergenlars%2Fci-detect-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vierbergenlars%2Fci-detect-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vierbergenlars%2Fci-detect-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vierbergenlars%2Fci-detect-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vierbergenlars","download_url":"https://codeload.github.com/vierbergenlars/ci-detect-gradle-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245108171,"owners_count":20561998,"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":["continuous-integration","gradle","gradle-plugin"],"created_at":"2024-10-11T14:15:35.333Z","updated_at":"2025-03-23T13:31:32.189Z","avatar_url":"https://github.com/vierbergenlars.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI detect plugin\n\n[![CI](https://github.com/vierbergenlars/ci-detect-gradle-plugin/workflows/CI/badge.svg)](https://github.com/vierbergenlars/ci-detect-gradle-plugin/actions?query=workflow%3ACI+branch%3Amaster)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vierbergenlars_ci-detect-gradle-plugin\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=vierbergenlars_ci-detect-gradle-plugin)\n[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/be/vbgn/ci-detect/be.vbgn.ci-detect.gradle.plugin/maven-metadata.xml.svg?colorB=007ec6\u0026label=be.vbgn.ci-detect)](https://plugins.gradle.org/plugin/be.vbgn.ci-detect)\n\nA gradle plugin that checks if it is running on a continuous integration platform and gives you access to the build metadata.\n\n## Installation\n\n```gradle\nplugins {\n    // Check https://plugins.gradle.org/plugin/be.vbgn.ci-detect for the latest version\n    id \"be.vbgn.ci-detect\" version \"0.1.0\"\n}\n```\n\n## Usage\n\nThis plugin gives you easy and consistent access to environment variables that CI platforms automatically add, independent of which CI solution you are using.\n\nCI build metadata is exposed through the `ci` variable in your `build.gradle`. It can also be used programmatically from other Gradle plugins or code.\n\n```gradle\n// Basic information\nci.isCi() // =\u003e true or false, depending on if you are running in a CI server or not\nci.reference // The current branch or tag that is being built\n\n// Branch builds\nci.branch // The current branch that is being built\n\n// Pull requests\nci.isPullRequest() // =\u003e true/false\nci.pullRequest // Pull request identifier (usually a string containing a number, depends on your SCM system)\nci.pullRequestTargetBranch // Branch where the pullrequest will be merged into\n\n// Tags\nci.isTag() //  =\u003e true/false, depending on if this is a git tag that is being built or not\nci.tag // The tag name that is being built\n\n// Platform information\nci.platform // =\u003e A string identifying the platform the build is run on.\n```\n\nSupported CI platforms:\n\n * [Travis CI](https://travis-ci.org)\n * [Jenkins](https://jenkins.io)\n * [GitLab CI](https://about.gitlab.com/product/continuous-integration/)\n * [Github actions](https://github.com/features/actions)\n * [Appveyor](https://www.appveyor.com)\n\n### Programmatic usage\n\n```java\nimport be.vbgn.gradle.cidetect.CiInformation;\n\nCiInformation ci = CiInformation.detect(); // Attempts to detect CI from environment variables\nCiInformation ci = CIInformation.detect(project); // Gives CI detectors access to the gradle Project variable, which may be used by detectors to extract additional information\n```\n\n# Extending\n\nYou can provide extra CI detectors by creating a provider extending [`be.vbgn.gradle.cidetect.provider.CiInformationProvider`](./src/main/java/be/vbgn/gradle/cidetect/provider/CiInformationProvider.java).\n\nThere are 2 ways to register extra CI detectors:\n\n * Using the ServiceLoader mechanism: [registering it as a service](https://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html) and placing your jar on the classpath.\n * Calling `CiInformationProvider#registerProvider()` from a separate Gradle plugin that is applied **before** `be.vbgn.ci-detect`.\n\nFor examples of providers, you can have a look at [the builtin providers](./src/main/java/be/vbgn/gradle/cidetect/impl).\n\n# Development\n\n## Creating a release\n\nEvery git tag is automatically published to the gradle plugins repository by Travis-CI.\n\nThis plugin follows SemVer and tags are managed with Reckon.\n\nTo create a release from a commit, use `./gradlew reckonTagPush -Preckon.scope=patch -Preckon.stage=final` to create a new patch release.\n\nTests are required to pass before a new release can be tagged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvierbergenlars%2Fci-detect-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvierbergenlars%2Fci-detect-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvierbergenlars%2Fci-detect-gradle-plugin/lists"}