From d1e8254c8b3606dfb7e15a13acb562a1420c3eec Mon Sep 17 00:00:00 2001 From: Son Luong Ngoc Date: Sun, 8 Dec 2019 00:11:34 +0100 Subject: [PATCH] Improved gitlab documentation --- docs/usage/gitlab.html.md | 6 +++--- source/ci_source/providers/GitLabCI.ts | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/usage/gitlab.html.md b/docs/usage/gitlab.html.md index dcd1cfc2b..b5e21e063 100644 --- a/docs/usage/gitlab.html.md +++ b/docs/usage/gitlab.html.md @@ -17,7 +17,7 @@ Then in your Dangerfiles you will have a fully fleshed out `danger.gitlab` objec ```ts import { danger, warn } from "danger" -if (danger.bitbucket_cloud.mr.title.includes("WIP")) { +if (danger.gitlab.mr.title.includes("WIP")) { warn("PR is considered WIP") } ``` @@ -29,7 +29,7 @@ danger.gitlab. /** The pull request and repository metadata */ metadata: RepoMetaData /** The Merge Request metadata */ - mr: BitBucketCloudPRDSL + mr: GitLabMR /** The commits associated with the merge request */ - commits: BitBucketCloudCommit[] + commits: GitLabMRCommit[] ``` diff --git a/source/ci_source/providers/GitLabCI.ts b/source/ci_source/providers/GitLabCI.ts index c0ebc5a36..cf7fc8adf 100644 --- a/source/ci_source/providers/GitLabCI.ts +++ b/source/ci_source/providers/GitLabCI.ts @@ -25,6 +25,10 @@ export class GitLabCI implements CISource { get repoSlug(): string { return this.env.CI_PROJECT_PATH } + + get commitHash(): string { + return this.env.CI_COMMIT_SHA + } } // See https://docs.gitlab.com/ee/ci/variables/predefined_variables.html