Skip to content

Commit 0c67133

Browse files
committed
setup the github token env for riggrep.
1 parent 25fceb1 commit 0c67133

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

buildspec/linuxTests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ env:
1313
# followed by Error: Could not delete obsolete instance handle Error: ENOENT: no such file or directory, unlink <path>
1414
AWS_TOOLKIT_TEST_CACHE_DIR: '/tmp/.vscode-test/'
1515
AWS_TOOLKIT_TEST_USER_DIR: '/tmp/.vscode-test/user-data/'
16-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
# GITHUB_TOKEN should be set in the CodeBuild project environment variables
17+
# or passed as a parameter to the build
1718

1819
phases:
1920
install:
@@ -26,6 +27,7 @@ phases:
2627
pre_build:
2728
commands:
2829
- export HOME=/home/codebuild-user
30+
# produce an API key, set the GITHUB_TOKEN environment var, and vscode-ripgrep will pick it up
2931
- export GITHUB_TOKEN=${GITHUB_TOKEN}
3032
- bash buildspec/shared/linux-pre_build.sh
3133

buildspec/packageTestVsix.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ env:
88
AWS_TOOLKIT_TEST_USER_DIR: '/tmp/'
99
# needed or else webpack will cause it to run out of memory
1010
NODE_OPTIONS: '--max-old-space-size=8192'
11-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1211

1312
phases:
1413
install:
@@ -21,7 +20,7 @@ phases:
2120
pre_build:
2221
commands:
2322
- export HOME=/home/codebuild-user
24-
- export GITHUB_TOKEN=${GITHUB_TOKEN}
23+
- export GITHUB_TOKEN=${GITHUB_READONLY_TOKEN}
2524
- bash buildspec/shared/linux-pre_build.sh
2625

2726
build:

buildspec/shared/linux-pre_build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ _SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1111
# Include common functions.
1212
. "${_SCRIPT_DIR}/common.sh"
1313

14+
# Set up GitHub token for vscode-ripgrep to avoid rate limiting
15+
if [ -n "$GITHUB_TOKEN" ]; then
16+
echo "GITHUB_TOKEN is set. vscode-ripgrep will use this for GitHub API authentication."
17+
else
18+
echo "WARNING: GITHUB_TOKEN is not set. GitHub API requests may be rate-limited."
19+
fi
20+
1421
# If present, log into CodeArtifact. Provides a fallback in case NPM is down.
1522
# Should only affect tests run through Toolkits-hosted CodeBuild.
1623
if [ "$TOOLKITS_CODEARTIFACT_DOMAIN" ] && [ "$TOOLKITS_CODEARTIFACT_REPO" ] && [ "$TOOLKITS_ACCOUNT_ID" ]; then

0 commit comments

Comments
 (0)