angular/.github/actions/deploy-docs-site/lib/credential.ts
Joey Perrott e205dcb21b ci: release angular.dev on each commit (#55792)
Release angular.dev on each commit to the appropriate version of the documentation site based on the current state of the repository.

PR Close #55792
2024-05-14 11:12:45 -07:00

15 lines
471 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;
}