Skip to content

Commit

Permalink
build: use github access token for docs site monitoring (angular#24691)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
devversion authored and forsti0506 committed Apr 3, 2022
1 parent df91a95 commit ef08dca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/docs-deploy/github-versioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import {
getNextBranchName,
} from '@angular/dev-infra-private/ng-dev';

import {githubAccessToken} from './utils';

export function getReleaseRepoWithApi(): ReleaseRepoWithApi {
const githubClient =
process.env.GITHUB_TOKEN !== undefined
? new AuthenticatedGithubClient(process.env.GITHUB_TOKEN)
githubAccessToken !== undefined
? new AuthenticatedGithubClient(githubAccessToken)
: new GithubClient();
const {github} = getConfig([assertValidGithubConfig]);

Expand Down
3 changes: 3 additions & 0 deletions scripts/docs-deploy/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const sites = {
new SiteTarget(`v${major}-material-angular-io`, `https://v${major}.material.angular.io`),
};

/** Optional Github access token. Can be used for querying the active release trains. */
export const githubAccessToken: string | undefined = process.env.DOCS_DEPLOY_GITHUB_TOKEN;

/** Configuration describing the Firebase project that we deploy to. */
export const firebaseConfig = {
projectId: 'material-angular-io',
Expand Down

0 comments on commit ef08dca

Please sign in to comment.