Skip to content

Commit 6fb828d

Browse files
committed
Allow token to be used as password
1 parent f632b88 commit 6fb828d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

ci/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
file: git-repo/ci/tasks/release.yml
7171
params:
7272
GITHUB_USERNAME: ((github-username))
73-
GITHUB_PASSWORD: ((github-ci-release-token))
73+
GITHUB_TOKEN: ((github-ci-release-token))
7474
- put: git-repo
7575
params:
7676
repository: release-git-repo

ci/tasks/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ outputs:
77
- name: built-artifact
88
params:
99
GITHUB_USERNAME:
10-
GITHUB_PASSWORD:
10+
GITHUB_TOKEN:
1111
caches:
1212
- path: maven
1313
run:

src/main/java/io/spring/githubchangeloggenerator/github/service/GitHubProperties.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.springframework.boot.context.properties.ConfigurationProperties;
2020
import org.springframework.boot.context.properties.ConstructorBinding;
2121
import org.springframework.boot.context.properties.bind.DefaultValue;
22+
import org.springframework.util.StringUtils;
2223

2324
/**
2425
* Github related properties.
@@ -45,10 +46,11 @@ public class GitHubProperties {
4546
*/
4647
private final String password;
4748

48-
public GitHubProperties(@DefaultValue("https://api.github.com") String apiUrl, String username, String password) {
49+
public GitHubProperties(@DefaultValue("https://api.github.com") String apiUrl, String username, String password,
50+
String token) {
4951
this.apiUrl = apiUrl;
5052
this.username = username;
51-
this.password = password;
53+
this.password = StringUtils.hasText(token) ? token : password;
5254
}
5355

5456
public String getApiUrl() {

0 commit comments

Comments
 (0)