Skip to content

Commit 651de3c

Browse files
devversionandrewseguin
authored andcommitted
build: use github access token for docs site monitoring (#24691)
We recently seemed to hit the rate limit in the docs site monitoring job. We can use a Github access token to avoid these rate limit failures. We move the token extraction to a common location where the GCP key is also extracted, and we use a more granular variable name to make sure it's obvious where the key is used (when added to CircleCI) (cherry picked from commit 8a5017d)
1 parent 2789b37 commit 651de3c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

scripts/docs-deploy/github-versioning.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import {
77
getNextBranchName,
88
} from '@angular/dev-infra-private/ng-dev';
99

10+
import {githubAccessToken} from './utils';
11+
1012
export function getReleaseRepoWithApi(): ReleaseRepoWithApi {
1113
const githubClient =
12-
process.env.GITHUB_TOKEN !== undefined
13-
? new AuthenticatedGithubClient(process.env.GITHUB_TOKEN)
14+
githubAccessToken !== undefined
15+
? new AuthenticatedGithubClient(githubAccessToken)
1416
: new GithubClient();
1517
const {github} = getConfig([assertValidGithubConfig]);
1618

scripts/docs-deploy/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const sites = {
2323
new SiteTarget(`v${major}-material-angular-io`, `https://v${major}.material.angular.io`),
2424
};
2525

26+
/** Optional Github access token. Can be used for querying the active release trains. */
27+
export const githubAccessToken: string | undefined = process.env.DOCS_DEPLOY_GITHUB_TOKEN;
28+
2629
/** Configuration describing the Firebase project that we deploy to. */
2730
export const firebaseConfig = {
2831
projectId: 'material-angular-io',

0 commit comments

Comments
 (0)