Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here is a table summarizing the most common variables in use , details below in the relevant SCM section

...

Note

For latestCommit parameter, we’re highlighting the short version in the screenshots below but the long/entire SHA identifier needs to be used.

GitHub

...

If you’re using the GitHub Actions or the GitHub Pull Request Builder plugin for Jenkins, you can use the following mapping to environment variables provided by the pluginvariables suggested below

Pull Request

Sealights PR Parameter

GitHub

Actions variables

GitHub PR Builder variables (Jenkins plugin)

Comment

pullRequestNumber

github.event.pull_request.number

ghprbPullId

latestCommit

github.event.pull_request.head.sha

ghprbActualCommit

repoUrl 

$GITHUB_SERVER_URL/$GITHUB_REPOSITORY

ghprbPullLink

Something similar to: https://github.mycompany.com/myappjava/ if the pull request URL is
https://github.mycompany.com/myappjava/pull/8031 in other words everything before word ‘pull’ like shown in the picture above

targetBranch

github.event.pull_request.base.ref

ghprbTargetBranch

This is the branch name itself and might need to have a prefix added (Like: "origin/") to match the branch that was provided to SeaLights when scanning the merged branch

...

Sealights PR Parameter

Bamboo Build env. variables

Comment

pullRequestNumber

Please refer to the workaround(s) shared in the comments of this Bamboo support page: https://jira.atlassian.com/browse/BAM-18350

latestCommit

bamboo.repository.pr.key

repoUrl 

bamboo.planRepository.<position>.repositoryUrl

targetBranch

bamboo.repository.pr.targetBranch

The base reference name of the webhook event that triggered the build. It is the branch reference for pull requests (i.e. target branch).
It may require some string manipulation to match the branch name that was provided to SeaLights when scanning the reference branch.

...

Sealights PR Parameter

env. variables

Comment

pullRequestNumber

System.PullRequest.PullRequestNumber

latestCommit

The default environment ADO variable Build.SourceVersion cannot be used. It is not providing the latest commit from the PR branch - as expected by Sealights - but only the local commit resulting from the merge operation.
A common solution is to retrieve the “-1” commit identifier in form the git log command.

repoUrl 

System.PullRequest.SourceRepositoryURI

targetBranch

System.PullRequest.TargetBranch

This is the branch name itself and might need some string manipulation to remove a prefix added (Like: "refs/heads/") to match the branch that was provided to SeaLights when scanning the merged branch.

Info

More details for ADO/TFS variables may be found in the official documentation: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables

...