Skip to main content

Danger

Danger automates code reviews through CI tools, aiding both code reviewers and developers who submit pull requests. It reduces the time reviewers spend on routine tasks, allowing more efficient code evaluation.

You can easily automate opened PRs with Appcircle's Danger integration.

For detailed information on the benefits that Danger, please refer to the following blog post:

Preview of Danger in CI: Automate Your Mobile Code Reviews - Appcircle Blog

warning

This tool does not support AzureDevOps. Therefore, if your repository is hosted on AzureDevOps, this tool will not function. Please use the Azure Bot for Swiftlint(for iOS) and Azure Bot for Detekt Report(for Android) components instead.

Prerequisites

The workflow steps that need to be executed before running the Danger step vary depending on the platform and are listed below:

Prerequisite Workflow StepDescription
Git CloneThe repository needs to be cloned to begin the badge-adding process. After this step, the variable AC_REPOSITORY_DIR will be set.
caution

Note that this component synchronizes with the Appcircle Triggers. Without a setup trigger, opening a PR will not trigger the pipeline, and Danger will not function.

Input Variables

Below is a list of input variables that can be used with this component with a description of each.

warning

Avoid hard-coding sensitive information like tokens and API keys directly into the step parameters.

We recommend using Environment Variables groups for such sensitive variables.

Variable NameDescriptionStatus
$AC_REPOSITORY_DIRSpecifies the cloned repository directory. This path will be generated after the Git Clone step.Required
$AC_DANGER_PATHSpecifies path of Dangerfile. This path comes from AC_REPOSITORY_DIR. If DangerFile is in main directory of your repository. Do not change.Required
$AC_DANGER_EXTRA_PARAMETERSExtra command line parameters. For Example: enter --verbose for verbose mode.Optional
$DANGER_GITHUB_API_TOKENGithub Access Token for the bot user.Optional
$DANGER_GITHUB_HOSTThe host that GitHub is running on. For example: git.corp.comOptional
$DANGER_GITHUB_API_BASE_URLThe host that the GitHub Enterprise API is reachable on. For example: https://git.corp.com/api/v3Optional
$DANGER_GITLAB_API_TOKENGitLab Access Token for the bot user.Optional
$DANGER_GITLAB_HOSTThe host that GitLab is running on. For example: git.corp.comOptional
$DANGER_GITLAB_API_BASE_URLThe host that the GitHub Enterprise API is reachable on. For example: https://git.corp.com/api/v4Optional
$DANGER_BITBUCKETCLOUD_USERNAMEBitbucket username for the bot user.Optional
$DANGER_BITBUCKETCLOUD_PASSWORDBitbucket password for the bot user.Optional
$DANGER_BITBUCKETCLOUD_UUIDBitbucket UUID of the bot user.Optional
$DANGER_BITBUCKETSERVER_USERNAMEBitbucket username for the bot user.Optional
$DANGER_BITBUCKETSERVER_PASSWORDBitbucket password for the bot user.Optional
$DANGER_BITBUCKETSERVER_HOSTThe host that Bitbucket is running on. For example: git.corp.comOptional

To access the source code of this component, please use the following link:

Preview of GitHub - appcircleio/appcircle-danger-component