Skip to content

Expose DANGER_GITLAB_API_TOKEN as value of component's variable

Peter Leitzen requested to merge pl-test-13 into main

What and why?

This MR reverts !13 (merged) and takes another approach on #1 (closed).

Instead of using DANGER_GITLAB_API_TOKEN internally we keep using GITLAB_API_TOKEN internally and only exports DANGER_GITLAB_API_TOKEN as value of component's value if inputs.gitlab_api_token_variable_name is not the default value (DANGER_GITLAB_API_TOKEN).

This provides backwards-compatibility for users of this component who used the default variable name DANGER_GITLAB_API_TOKEN because the corresponding CI/CD variable does not to be Expanded which was needed after !13 (merged).

Verification

CI/CD variable danger-review danger-review dry-run
<none> https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533305828 (dry-run) https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533305832
DANGER_GITLAB_API_TOKEN https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533245986 https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533245988
Invalid DANGER_GITLAB_API_TOKEN https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533689140 https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533689144
FOO_TOKEN https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533348117 https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533348129
FOO_TOKEN Expanded https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533338358 https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533338361
INVALID FOO_TOKEN https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533415539 https://gitlab.com/gitlab-org/components/danger-review/-/jobs/8533415540
Edited by Peter Leitzen

Merge request reports

Loading