Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
provider-gitlab
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
go-semantic-release
provider-gitlab
Commits
c088a128
Commit
c088a128
authored
11 months ago
by
Pavel Pletenev
Committed by
Christoph Witzko
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: Allow specify job token as token in config
parent
148b9011
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/provider/gitlab.go
+22
-21
22 additions, 21 deletions
pkg/provider/gitlab.go
with
22 additions
and
21 deletions
pkg/provider/gitlab.go
+
22
−
21
View file @
c088a128
...
...
@@ -38,15 +38,16 @@ func (repo *GitLabRepository) Init(config map[string]string) error {
token
:=
config
[
"token"
]
if
token
==
""
{
token
=
os
.
Getenv
(
"GITLAB_TOKEN"
)
ci_job_token
:=
os
.
Getenv
(
"CI_JOB_TOKEN"
)
}
ciJobToken
:=
os
.
Getenv
(
"CI_JOB_TOKEN"
)
if
token
==
""
{
if
ci
_job_t
oken
==
""
{
if
ci
JobT
oken
==
""
{
return
errors
.
New
(
"gitlab token missing"
)
}
token
=
ci
_job_t
oken
token
=
ci
JobT
oken
}
// use the same strategy as goreleaser
if
token
==
ci
_job_t
oken
{
if
token
==
ci
JobT
oken
{
repo
.
useJobToken
=
true
if
os
.
Getenv
(
"GIT_STRATEGY"
)
==
"none"
{
return
errors
.
New
(
"can not use job token with sparse-checkout repository"
)
...
...
@@ -61,7 +62,7 @@ func (repo *GitLabRepository) Init(config map[string]string) error {
return
errors
.
New
(
"failed to initialize local git repository: "
+
err
.
Error
())
}
}
}
branch
:=
config
[
"gitlab_branch"
]
if
branch
==
""
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment