Skip to content

Commit 1dfcb79

Browse files
committed
Merge pull request #86 from LinqLover/github-api-token
For GitHub API requests, try to use GITHUB_TOKEN on CI
2 parents 0d6ed38 + bab1887 commit 1dfcb79

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
requests
22
getShaOfVersion: aString
33
| response json |
4-
response := WebClient httpGet: (self githubApiUrlForVersion: aString).
4+
response := WebClient new
5+
httpGet: (self githubApiUrlForVersion: aString)
6+
do: [:request |
7+
| token |
8+
token := nil.
9+
(self environment classNamed: #SmalltalkCI) ifNotNil: [:sci |
10+
token := sci getEnv: 'GITHUB_TOKEN'].
11+
(token isEmptyOrNil and: [FileDirectory respondsTo: #getenv:])
12+
ifTrue: [token := FileDirectory getenv: 'GITHUB_TOKEN'].
13+
token isEmptyOrNil ifFalse:
14+
[request headerAt: 'Authorization' put: 'token ' , token]].
515
json := response content parseAsJson.
616
response code = 200 ifFalse: [
717
^ self error: ('Error while trying to resolve git-s version {1}: {2}'
818
format: {aString printString. json at: 'message'})].
9-
^ json at: 'sha'
19+
^ json at: 'sha'

src/GitS-Core.package/GSSelfUpdater.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"changeLog" : "mad 8/13/2025 14:18",
99
"checkForNewVersion" : "mad 10/25/2024 11:32",
1010
"fullRepositoryName" : "mad 10/9/2024 16:33",
11-
"getShaOfVersion:" : "mad 10/24/2024 15:07",
11+
"getShaOfVersion:" : "ct 10/6/2025 04:04",
1212
"githubApiUrlForVersion:" : "mad 10/9/2024 18:38",
1313
"installScriptForInstalledVersion" : "mad 10/9/2024 16:51",
1414
"installScriptForVersion:" : "mad 10/9/2024 16:50",

0 commit comments

Comments
 (0)