Skip to content

Commit

Permalink
Merge pull request #1687 from carlallen/patch-1
Browse files Browse the repository at this point in the history
Use the merge request branch on merge requests
  • Loading branch information
ivoanjo authored Sep 17, 2021
2 parents ecfc3f3 + 1b5a719 commit f05a273
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/datadog/ci/ext/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def extract_github_actions(env)
def extract_gitlab(env)
url = env['CI_PIPELINE_URL']
{
Datadog::Ext::Git::TAG_BRANCH => env['CI_COMMIT_BRANCH'],
Datadog::Ext::Git::TAG_BRANCH => env['CI_COMMIT_REF_NAME'],
Datadog::Ext::Git::TAG_COMMIT_SHA => env['CI_COMMIT_SHA'],
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['CI_REPOSITORY_URL'],
Datadog::Ext::Git::TAG_TAG => env['CI_COMMIT_TAG'],
Expand Down
32 changes: 16 additions & 16 deletions spec/datadog/ci/ext/fixtures/ci/gitlab.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -31,7 +31,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -63,7 +63,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -95,7 +95,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -127,7 +127,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -161,7 +161,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -195,7 +195,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -229,7 +229,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -261,7 +261,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -291,7 +291,7 @@
],
[
{
"CI_COMMIT_BRANCH": "refs/heads/master",
"CI_COMMIT_REF_NAME": "refs/heads/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -323,7 +323,7 @@
],
[
{
"CI_COMMIT_BRANCH": "refs/heads/feature/one",
"CI_COMMIT_REF_NAME": "refs/heads/feature/one",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -451,7 +451,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -483,7 +483,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -515,7 +515,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -547,7 +547,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down Expand Up @@ -579,7 +579,7 @@
],
[
{
"CI_COMMIT_BRANCH": "origin/master",
"CI_COMMIT_REF_NAME": "origin/master",
"CI_COMMIT_MESSAGE": "gitlab-git-commit-message",
"CI_COMMIT_SHA": "gitlab-git-commit",
"CI_JOB_NAME": "gitlab-job-name",
Expand Down

0 comments on commit f05a273

Please sign in to comment.