mirror of
https://github.com/Azure/setup-helm.git
synced 2025-12-23 07:45:49 +00:00
committed by
GitHub
parent
e4f3964f67
commit
84b304dfb7
27
node_modules/@octokit/auth-action/dist-node/index.js
generated
vendored
Normal file
27
node_modules/@octokit/auth-action/dist-node/index.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var authToken = require('@octokit/auth-token');
|
||||
|
||||
const createActionAuth = function createActionAuth() {
|
||||
if (!process.env.GITHUB_ACTION) {
|
||||
throw new Error("[@octokit/auth-action] `GITHUB_ACTION` environment variable is not set. @octokit/auth-action is meant to be used in GitHub Actions only.");
|
||||
}
|
||||
|
||||
const definitions = [process.env.GITHUB_TOKEN, process.env.INPUT_GITHUB_TOKEN, process.env.INPUT_TOKEN].filter(Boolean);
|
||||
|
||||
if (definitions.length === 0) {
|
||||
throw new Error("[@octokit/auth-action] `GITHUB_TOKEN` variable is not set. It must be set on either `env:` or `with:`. See https://github.com/octokit/auth-action.js#createactionauth");
|
||||
}
|
||||
|
||||
if (definitions.length > 1) {
|
||||
throw new Error("[@octokit/auth-action] The token variable is specified more than once. Use either `with.token`, `with.GITHUB_TOKEN`, or `env.GITHUB_TOKEN`. See https://github.com/octokit/auth-action.js#createactionauth");
|
||||
}
|
||||
|
||||
const token = definitions.pop();
|
||||
return authToken.createTokenAuth(token);
|
||||
};
|
||||
|
||||
exports.createActionAuth = createActionAuth;
|
||||
//# sourceMappingURL=index.js.map
|
||||
Reference in New Issue
Block a user