Commit Information
Displaying Commit Information on Currents
Currents client SDKs use a set of git commands to obtain git commit information. This information is being used to display Run Details and enable certain platform features, for example
show analytics filtered by branch flakiness
searching items based on commit message
integration with SVC providers
Currents uses the following information:
Run Title
Commit message
Branch Link
Git origin + branch name
Commit Link
Git origin + commit SHA
Author
Commit author
Git Commands
Currents uses the following commands to get the commit data (see src/git-api.js):
git branch:
git rev-parse --abbrev-ref HEADcommit message:
git show -s --pretty=%Bcommit author email:
git show -s --pretty=%aecommit author name:
git show -s --pretty=%ancommit SHA:
git show -s --pretty=%Hgit origin:
git config --get remote.origin.url
GitHub Actions and Pull Requests
Currents automatically detects PR information, including PR title and the target branch when running in GitHub Actions as a result of pull_request GHA event. When a Pull Request is detected, Currents uses the following Pull Request data instead of the commit information.
Run Title
Pull Request title
Commit Link
Pull Request discussion link
Commit SHA
Source branch latest commit SHA
You can change this behavior in Project Settings.
Merge Commits in Pull Request Runs
On pull request runs, some CI providers check out a merge commit that they create by merging the pull request into the target branch, for example Merge <sha> into <sha> in GitHub Actions. @currents/playwright 2.5.1 and @currents/cmd 1.11.0 record the last commit of the pull request instead. They read its SHA from:
GitHub Actions
pull_request.head.sha in the event file (GITHUB_EVENT_PATH)
GitLab CI, merged results pipelines
CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
Azure Pipelines
SYSTEM_PULLREQUEST_SOURCECOMMITID
Travis CI
TRAVIS_PULL_REQUEST_SHA
Semaphore
SEMAPHORE_GIT_PR_SHA
Buildkite
BUILDKITE_PULL_REQUEST_HEAD_COMMIT
Bitbucket Pipelines
BITBUCKET_COMMIT
The reporter uses the commit only when it is a parent of the checked-out merge commit. When a shallow clone doesn't have the commit, the reporter fetches it with git fetch --depth=1 origin <sha>, with a 3 second timeout. If the fetch fails, the run shows the merge commit's message and author. In GitHub Actions, the commit SHA and branch still come from the pull request.
Set
CURRENTS_DISABLE_HEAD_COMMIT_FETCH=trueto turn the fetch off.Set
COMMIT_INFO_SHAto record a specific commit. The reporter then skips this step.
Jenkins sets no variable with the pull request commit, so Currents records the merge commit that Jenkins creates.
Overriding Commit Info
You can override the commit info by manually setting environment variables:
For example, if .git directory isn't available on the CI machine and the commands mentioned above return no value, you can set the environment variables explicitly. This method can be helpful for non-traditional setups, for example:
tests repo is different from application source code repo and you want to show the source code commit details in the dashboard
manual CI pipeline invocation
local testing
Troubleshooting Commit Info
If you're not seeing git information for your runs, most chances .git directory is not available in the CI environment and Currents can't detect the commit information automatically.
Run the Git Commands as part of your CI jobs manually and capture the output
Use the environment variables from Overriding Commit Info section
Enable the corresponding client SDK debug mode (Playwright or Cypress)
Contact our support channels for assistance
Last updated
Was this helpful?