Skip to content

Gated commit

Gated Commit is an integration pattern where a commit is blocked until defined checks pass. It helps developers avoid breaking the code and prevents poor-quality changes from entering the integration branch. These checks occur before committing changes to the version control system (VCS).

Installation Steps

  1. Download the CLI from your Embold Account (Releases tab). Example file name: browserstack-codequality-scanner.tar.gz.
  2. Create a folder emboldLatest. Extract the downloaded tar in emboldLatest location.
  3. Create two folder with name “corona“ and “logs“ inside emboldLatest Folder.
  4. Set following variables globally.
  EMBOLD_SCANNER_HOME=<path-till-embold-scanner>
  CORONA_HOME=<path-till-corona>
  CORONA_LOG=<path-till-corona-log>
  EMBOLD_URL=<embold_server_url>
  EMBOLD_TOKEN=<embold_token>
  1. Copy the hook scripts:
  • Git: Copy commit-msg from $EMBOLD_SCANNER_HOME/config/commit-msg to <baseDir>/.git/hooks/ Verify both scripts are executable.
  1. Make required code changes.
  2. Commit:
git commit -m "Committing changes"
  • On success: no errors are shown.
  • On failure: issues are listed in the console.

Overriding the Gate

In exceptional cases you may need to commit despite failing checks. Two options:

  • Force Commit: Runs Embold analysis but does not block the commit even if issues exist. New issues are appended to the commit message.

    git commit -m "Committing changes" embold --force-commit

    Required flag: embold --force-commit

  • Skip: Skips analysis entirely; commit proceeds and the hook updates the commit message accordingly.

    git commit -m "Committing changes" embold --skip

    Required flag: embold --skip