mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
a531106578
This commit fixes that the angular.dev deployment is subject to GitHub API rate limiting due to lack of an access token. This commit fixes this, similar to how we fixed it in `angular/components`. The token is pure read-only. PR Close #56929
21 lines
660 B
TypeScript
21 lines
660 B
TypeScript
import {fileSync} from 'tmp';
|
|
import {writeSync} from 'fs';
|
|
import {getInput, setSecret} from '@actions/core';
|
|
|
|
let credentialFilePath: undefined | string;
|
|
|
|
export function getCredentialFilePath(): string {
|
|
if (credentialFilePath === undefined) {
|
|
const tmpFile = fileSync({postfix: '.json'});
|
|
writeSync(tmpFile.fd, getInput('serviceKey', {required: true}));
|
|
setSecret(tmpFile.name);
|
|
credentialFilePath = tmpFile.name;
|
|
}
|
|
return credentialFilePath;
|
|
}
|
|
|
|
/** Github access token. Used for querying the active release trains. */
|
|
export const githubReleaseTrainReadToken: string = getInput('githubReleaseTrainReadToken', {
|
|
required: true,
|
|
});
|