Skip to content

Commit 44a34c0

Browse files
committed
projects: Update AppVeyor to use secure github API access to prevent usage limits.
1 parent 48bc7a6 commit 44a34c0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

SMP/appveyor.yml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ platform:
1313
- x64
1414

1515
environment:
16+
GITHUBTOKEN:
17+
secure: aiTcAD/YitqgwuiBdC3ImXiUlHfIIDD7ayjCs3Y3aAO5vEm1gA7flCZpUZ60a5am
1618
matrix:
1719
- MSVC_VER: 12
1820
- MSVC_VER: 14

SMP/project_get_dependencies.bat

+6-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ SET REPONAME=%~1
124124
REM Get latest release
125125
ECHO %REPONAME%: Getting latest release...
126126
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+
)
128133
IF NOT %ERRORLEVEL% == 0 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
129134
REM Get tag for latest release
130135
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F

0 commit comments

Comments
 (0)