Commit 44a34c0 1 parent 48bc7a6 commit 44a34c0 Copy full SHA for 44a34c0
File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ platform:
13
13
- x64
14
14
15
15
environment :
16
+ GITHUBTOKEN :
17
+ secure : aiTcAD/YitqgwuiBdC3ImXiUlHfIIDD7ayjCs3Y3aAO5vEm1gA7flCZpUZ60a5am
16
18
matrix :
17
19
- MSVC_VER : 12
18
20
- MSVC_VER : 14
Original file line number Diff line number Diff line change @@ -124,7 +124,12 @@ SET REPONAME=%~1
124
124
REM Get latest release
125
125
ECHO %REPONAME% : Getting latest release...
126
126
SET UPSTREAMAPIURL = %UPSTREAMURL:github.com =api.github.com/repos %
127
- powershell -nologo -noprofile -command " try { Invoke-RestMethod -Uri %UPSTREAMAPIURL% /%REPONAME% /releases/latest > latest.json } catch {exit 1}"
127
+ REM Check if secure OAuth is available
128
+ IF " %GITHUBTOKEN% " == " " (
129
+ powershell -nologo -noprofile -command " try { Invoke-RestMethod -Uri %UPSTREAMAPIURL% /%REPONAME% /releases/latest > latest.json } catch {exit 1}"
130
+ ) ELSE (
131
+ powershell -nologo -noprofile -command " try { Invoke-RestMethod -Uri %UPSTREAMAPIURL% /%REPONAME% /releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN% '} > latest.json } catch {exit 1}"
132
+ )
128
133
IF NOT %ERRORLEVEL% == 0 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
129
134
REM Get tag for latest release
130
135
FOR /F " tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^ | FINDSTR /B " tag_name" `) DO SET TAG = %%F
You can’t perform that action at this time.
0 commit comments