Skip to content

Commit c708f33

Browse files
authored
Merge pull request #418 from chmouel/issue-416-bitbucket-cloud-no-provider.user-has-been-set
2 parents b2dc9e5 + ee19564 commit c708f33

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

docs/install.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ Pipelines-As-Code has a full support on Bitbucket Cloud on
344344

345345
<https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/>
346346

347+
Add those permissions to the token :
348+
349+
![image](https://user-images.githubusercontent.com/98980/154526912-75c52ded-45e9-42d4-8c09-908b86eb57b4.png)
350+
347351
Make sure you note somewhere the generated token or otherwise you will have to
348352
recreate it.
349353

pkg/pipelineascode/pipelineascode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func Run(ctx context.Context, cs *params.Run, providerintf provider.Interface, k
5757
return nil
5858
}
5959

60-
if repo.Spec.GitProvider != nil && repo.Spec.GitProvider.URL != "" {
60+
if repo.Spec.GitProvider != nil {
6161
err := secretFromRepository(ctx, cs, k8int, providerintf.GetConfig(), repo)
6262
if err != nil {
6363
return err

pkg/test/repository/repository.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,16 @@ func NewRepo(opts RepoTestcreationOpts) *v1alpha1.Repository {
6666
},
6767
Spec: v1alpha1.RepositorySpec{
6868
URL: opts.URL,
69-
GitProvider: &v1alpha1.GitProvider{
70-
Secret: &v1alpha1.GitProviderSecret{},
71-
},
7269
},
7370
Status: opts.RepoStatus,
7471
}
72+
73+
if opts.SecretName != "" || opts.ProviderURL != "" {
74+
repo.Spec.GitProvider = &v1alpha1.GitProvider{
75+
Secret: &v1alpha1.GitProviderSecret{},
76+
}
77+
}
78+
7579
if opts.SecretName != "" {
7680
repo.Spec.GitProvider.Secret = &v1alpha1.GitProviderSecret{
7781
Name: opts.SecretName,

0 commit comments

Comments
 (0)