mirror of
https://github.com/docker/login-action.git
synced 2026-10-02 16:26:07 +03:00
Merge pull request #945 from crazy-max/fix-scope-dir-dockerhub
fix scoped Docker Hub cleanup path when registry is omitted
This commit is contained in:
5 files changed
+33
-15
No files matched your search
@@ -1,6 +1,17 @@
|
||||
import {expect, test} from 'vitest';
|
||||
import {afterEach, expect, test} from 'vitest';
|
||||
import * as path from 'path';
|
||||
|
||||
import {getInputs} from '../src/context.js';
|
||||
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
|
||||
|
||||
import {getAuthList, getInputs} from '../src/context.js';
|
||||
|
||||
afterEach(() => {
|
||||
for (const key of Object.keys(process.env)) {
|
||||
if (key.startsWith('INPUT_')) {
|
||||
delete process.env[key];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('with password and username getInputs does not throw error', async () => {
|
||||
process.env['INPUT_USERNAME'] = 'dbowie';
|
||||
@@ -10,3 +21,15 @@ test('with password and username getInputs does not throw error', async () => {
|
||||
getInputs();
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
test('getAuthList uses the default Docker Hub registry when computing scoped config dir', async () => {
|
||||
process.env['INPUT_USERNAME'] = 'dbowie';
|
||||
process.env['INPUT_PASSWORD'] = 'groundcontrol';
|
||||
process.env['INPUT_SCOPE'] = 'myscope';
|
||||
process.env['INPUT_LOGOUT'] = 'false';
|
||||
const [auth] = getAuthList(getInputs());
|
||||
expect(auth).toMatchObject({
|
||||
registry: 'docker.io',
|
||||
configDir: path.join(Buildx.configDir, 'config', 'registry-1.docker.io', 'myscope')
|
||||
});
|
||||
});
|
||||
@@ -1,15 +1,10 @@
|
||||
import {expect, test, vi} from 'vitest';
|
||||
import * as path from 'path';
|
||||
|
||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
|
||||
|
||||
import {loginStandard, logout} from '../src/docker.js';
|
||||
|
||||
process.env['RUNNER_TEMP'] = path.join(__dirname, 'runner');
|
||||
|
||||
test('loginStandard calls exec', async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
const execSpy = vi.spyOn(Docker, 'getExecOutput').mockImplementation(async () => {
|
||||
return {
|
||||
exitCode: expect.any(Number),
|
||||
@@ -38,8 +33,6 @@ test('loginStandard calls exec', async () => {
|
||||
});
|
||||
|
||||
test('logout calls exec', async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
const execSpy = vi.spyOn(Docker, 'getExecOutput').mockImplementation(async () => {
|
||||
return {
|
||||
exitCode: expect.any(Number),
|
||||
|
||||
+1
-1
@@ -14,5 +14,5 @@ function isNothing(e){return typeof e==="undefined"||e===null}function js_yaml_i
|
||||
/* v8 ignore next -- @preserve */
|
||||
()=>new ArrayBuffer(0)))}}function isJSONResponse(e){return e.type==="application/json"||e.type==="application/scim+json"}function toErrorMessage(e){if(typeof e==="string"){return e}if(e instanceof ArrayBuffer){return"Unknown error"}if("message"in e){const t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map((e=>JSON.stringify(e))).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function dist_bundle_withDefaults(e,t){const n=e.defaults(t);const newApi=function(e,t){const o=n.merge(e,t);if(!o.request||!o.request.hook){return fetchWrapper(n.parse(o))}const request2=(e,t)=>fetchWrapper(n.parse(n.merge(e,t)));Object.assign(request2,{endpoint:n,defaults:dist_bundle_withDefaults.bind(null,n)});return o.request.hook(request2,o)};return Object.assign(newApi,{endpoint:n,defaults:dist_bundle_withDefaults.bind(null,n)})}var lh=dist_bundle_withDefaults(Yf,ch);
|
||||
/* v8 ignore next -- @preserve */
|
||||
/* v8 ignore else -- @preserve */var uh="0.0.0-development";function _buildMessageForResponseErrors(e){return`Request failed due to following response errors:\n`+e.errors.map((e=>` - ${e.message}`)).join("\n")}var dh=class extends Error{constructor(e,t,n){super(_buildMessageForResponseErrors(n));this.request=e;this.headers=t;this.response=n;this.errors=n.errors;this.data=n.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}name="GraphqlResponseError";errors;data};var ph=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Ah=["query","method","url"];var mh=/\/api\/v3\/?$/;function graphql(e,t,n){if(n){if(typeof t==="string"&&"query"in n){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const e in n){if(!Ah.includes(e))continue;return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}}const o=typeof t==="string"?Object.assign({query:t},n):t;const i=Object.keys(o).reduce(((e,t)=>{if(ph.includes(t)){e[t]=o[t];return e}if(!e.variables){e.variables={}}e.variables[t]=o[t];return e}),{});const c=o.baseUrl||e.endpoint.DEFAULTS.baseUrl;if(mh.test(c)){i.url=c.replace(mh,"/api/graphql")}return e(i).then((e=>{if(e.data.errors){const t={};for(const n of Object.keys(e.headers)){t[n]=e.headers[n]}throw new dh(i,t,e.data)}return e.data.data}))}function graphql_dist_bundle_withDefaults(e,t){const n=e.defaults(t);const newApi=(e,t)=>graphql(n,e,t);return Object.assign(newApi,{defaults:graphql_dist_bundle_withDefaults.bind(null,n),endpoint:n.endpoint})}var gh=graphql_dist_bundle_withDefaults(lh,{headers:{"user-agent":`octokit-graphql.js/${uh} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}var fh="(?:[a-zA-Z0-9_-]+)";var hh="\\.";var yh=new RegExp(`^${fh}${hh}${fh}${hh}${fh}$`);var Eh=yh.test.bind(yh);async function auth(e){const t=Eh(e);const n=e.startsWith("v1.")||e.startsWith("ghs_");const o=e.startsWith("ghu_");const i=t?"app":n?"installation":o?"user-to-server":"oauth";return{type:"token",token:e,tokenType:i}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,t,n,o){const i=t.endpoint.merge(n,o);i.headers.authorization=withAuthorizationPrefix(e);return t(i)}var Ch=function createTokenAuth2(e){if(!e){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof e!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}e=e.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})};const Ih="7.0.6";const dist_src_noop=()=>{};const bh=console.warn.bind(console);const Sh=console.error.bind(console);function createLogger(e={}){if(typeof e.debug!=="function"){e.debug=dist_src_noop}if(typeof e.info!=="function"){e.info=dist_src_noop}if(typeof e.warn!=="function"){e.warn=bh}if(typeof e.error!=="function"){e.error=Sh}return e}const Bh=`octokit-core.js/${Ih} ${getUserAgent()}`;class Octokit{static VERSION=Ih;static defaults(e){const t=class extends(this){constructor(...t){const n=t[0]||{};if(typeof e==="function"){super(e(n));return}super(Object.assign({},e,n,n.userAgent&&e.userAgent?{userAgent:`${n.userAgent} ${e.userAgent}`}:null))}};return t}static plugins=[];static plugin(...e){const t=this.plugins;const n=class extends(this){static plugins=t.concat(e.filter((e=>!t.includes(e))))};return n}constructor(e={}){const t=new Gf.Collection;const n={baseUrl:lh.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};n.headers["user-agent"]=e.userAgent?`${e.userAgent} ${Bh}`:Bh;if(e.baseUrl){n.baseUrl=e.baseUrl}if(e.previews){n.mediaType.previews=e.previews}if(e.timeZone){n.headers["time-zone"]=e.timeZone}this.request=lh.defaults(n);this.graphql=withCustomRequest(this.request).defaults(n);this.log=createLogger(e.log);this.hook=t;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const n=Ch(e.auth);t.wrap("request",n.hook);this.auth=n}}else{const{authStrategy:n,...o}=e;const i=n(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},e.auth));t.wrap("request",i.hook);this.auth=i}const o=this.constructor;for(let t=0;t<o.plugins.length;++t){Object.assign(this,o.plugins[t](this,e))}}request;graphql;log;hook;auth}const wh="17.0.0";const Rh={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repositoLine truncated
|
||||
/* v8 ignore else -- @preserve */var uh="0.0.0-development";function _buildMessageForResponseErrors(e){return`Request failed due to following response errors:\n`+e.errors.map((e=>` - ${e.message}`)).join("\n")}var dh=class extends Error{constructor(e,t,n){super(_buildMessageForResponseErrors(n));this.request=e;this.headers=t;this.response=n;this.errors=n.errors;this.data=n.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}name="GraphqlResponseError";errors;data};var ph=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Ah=["query","method","url"];var mh=/\/api\/v3\/?$/;function graphql(e,t,n){if(n){if(typeof t==="string"&&"query"in n){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const e in n){if(!Ah.includes(e))continue;return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}}const o=typeof t==="string"?Object.assign({query:t},n):t;const i=Object.keys(o).reduce(((e,t)=>{if(ph.includes(t)){e[t]=o[t];return e}if(!e.variables){e.variables={}}e.variables[t]=o[t];return e}),{});const c=o.baseUrl||e.endpoint.DEFAULTS.baseUrl;if(mh.test(c)){i.url=c.replace(mh,"/api/graphql")}return e(i).then((e=>{if(e.data.errors){const t={};for(const n of Object.keys(e.headers)){t[n]=e.headers[n]}throw new dh(i,t,e.data)}return e.data.data}))}function graphql_dist_bundle_withDefaults(e,t){const n=e.defaults(t);const newApi=(e,t)=>graphql(n,e,t);return Object.assign(newApi,{defaults:graphql_dist_bundle_withDefaults.bind(null,n),endpoint:n.endpoint})}var gh=graphql_dist_bundle_withDefaults(lh,{headers:{"user-agent":`octokit-graphql.js/${uh} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}var fh="(?:[a-zA-Z0-9_-]+)";var hh="\\.";var yh=new RegExp(`^${fh}${hh}${fh}${hh}${fh}$`);var Eh=yh.test.bind(yh);async function auth(e){const t=Eh(e);const n=e.startsWith("v1.")||e.startsWith("ghs_");const o=e.startsWith("ghu_");const i=t?"app":n?"installation":o?"user-to-server":"oauth";return{type:"token",token:e,tokenType:i}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,t,n,o){const i=t.endpoint.merge(n,o);i.headers.authorization=withAuthorizationPrefix(e);return t(i)}var Ch=function createTokenAuth2(e){if(!e){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof e!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}e=e.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})};const Ih="7.0.6";const dist_src_noop=()=>{};const bh=console.warn.bind(console);const Sh=console.error.bind(console);function createLogger(e={}){if(typeof e.debug!=="function"){e.debug=dist_src_noop}if(typeof e.info!=="function"){e.info=dist_src_noop}if(typeof e.warn!=="function"){e.warn=bh}if(typeof e.error!=="function"){e.error=Sh}return e}const Bh=`octokit-core.js/${Ih} ${getUserAgent()}`;class Octokit{static VERSION=Ih;static defaults(e){const t=class extends(this){constructor(...t){const n=t[0]||{};if(typeof e==="function"){super(e(n));return}super(Object.assign({},e,n,n.userAgent&&e.userAgent?{userAgent:`${n.userAgent} ${e.userAgent}`}:null))}};return t}static plugins=[];static plugin(...e){const t=this.plugins;const n=class extends(this){static plugins=t.concat(e.filter((e=>!t.includes(e))))};return n}constructor(e={}){const t=new Gf.Collection;const n={baseUrl:lh.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};n.headers["user-agent"]=e.userAgent?`${e.userAgent} ${Bh}`:Bh;if(e.baseUrl){n.baseUrl=e.baseUrl}if(e.previews){n.mediaType.previews=e.previews}if(e.timeZone){n.headers["time-zone"]=e.timeZone}this.request=lh.defaults(n);this.graphql=withCustomRequest(this.request).defaults(n);this.log=createLogger(e.log);this.hook=t;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const n=Ch(e.auth);t.wrap("request",n.hook);this.auth=n}}else{const{authStrategy:n,...o}=e;const i=n(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},e.auth));t.wrap("request",i.hook);this.auth=i}const o=this.constructor;for(let t=0;t<o.plugins.length;++t){Object.assign(this,o.plugins[t](this,e))}}request;graphql;log;hook;auth}const wh="17.0.0";const Rh={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repositoLine truncated
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","Object","defineProperty","exports","ClientStreamingCall","constructor","method","requestHeaders","request","headers","response","status","trailers","requests","onfulfilled","onrejected","promiseFinished","reason","all","Deferred","DeferredState","preventUnhandledRejectionWarning","_state","PENDING","_promise","_resolve","_reject","catch","_","state","promise","Error","toLowerCase","RESOLVED","REJECTED","resolvePending","val","rejectPending","DuplexStreamingCall","responses","__webpack_unused_export__","service_type_1","__webpack_require__","enumerable","get","ServiceType","reflection_info_1","readMethodOptions","readMethodOption","readServiceOption","rpc_error_1","RpcError","rpc_options_1","mergeRpcOptions","rpc_output_stream_1","RpcOutputStreamController","test_transport_1","TestTransport","deferred_1","duplex_streaming_call_1","client_streaming_call_1","server_streaming_call_1","ServerStreamingCall","unary_call_1","UnaryCall","rpc_interceptor_1","stackIntercept","stackDuplexStreamingInterceptors","stackClientStreamingInterceptors","stackServerStreamingInterceptors","stackUnaryInterceptors","server_call_context_1","ServerCallContextController","normalizeMethodInfo","runtime_1","service","_a","_b","_c","m","localName","lowerCamelCase","name","serverStreaming","clientStreaming","options","idempotency","undefined","methodName","extensionName","extensionType","methods","find","i","fromJson","optionVal","message","code","meta","super","setPrototypeOf","prototype","toString","l","push","serviceName","entries","length","k","v","join","kind","transport","input","_d","tail","mtd","inp","opt","unary","curr","interceptors","filter","interceptUnary","reverse","interceptServerStreaming","interceptClientStreaming","duplex","interceptDuplex","assertNever","defaults","o","copy","key","keys","jsonOptions","mergeJsonOptions","binaryOptions","mergeBinaryOptions","concat","a","into","c","Date","getTime","Array","isArray","_lis","nxt","msg","err","cmp","_closed","_itState","q","onNext","callback","addLis","onMessage","onError","onComplete","list","indexOf","splice","clearLis","values","closed","notifyNext","error","complete","assert","notifyMessage","notifyError","notifyComplete","pushIt","forEach","Symbol","asyncIterator","p","first","shift","deadline","sendResponseHeadersFn","defaultStatus","detail","_cancelled","_listeners","_sendRH","notifyCancelled","sendResponseHeaders","data","cancelled","onCancel","typeName","map","suppressUncaughtRejections","headerDelay","responseDelay","betweenResponseDelay","afterResponseDelay","sentMessages","lastInput","TestInputStream","sent","single","sendComplete","completed","promiseHeaders","defaultHeaders","promiseSingleResponse","r","O","create","is","streamResponses","stream","abort","messages","delay","promiseStatus","promiseTrailers","defaultTrailers","maybeSuppressUncaught","mergeOptions","headersPromise","responsePromise","statusPromise","trailersPromise","outputStream","responseStreamClosedPromise","responseHeader","responseTrailer","ms","aborted","id","setTimeout","addEventListener","ev","clearTimeout","_completed","_sent","send","inputMessage","delayMs","inputComplete","assertFloat32","assertUInt32","assertInt32","condition","FLOAT32_MAX","FLOAT32_MIN","UINT32_MAX","INT32_MAX","INT32_MIN","arg","Number","isInteger","isFinite","base64encode","base64decode","encTable","split","decTable","charCodeAt","base64Str","es","bytes","Uint8Array","bytePos","groupPos","b","subarray","base64","WireType","UnknownFieldHandler","symbol","for","onRead","fieldNo","wireType","container","no","onWrite","writer","tag","raw","uf","last","slice","assign","BinaryReader","binaryReadOptions","binary_format_contract_1","pb_long_1","goog_varint_1","defaultsRead","readUnknownField","readerFactory","buf","textDecoder","varint64","varint64read","uint32","varint32read","len","pos","view","DataView","buffer","byteOffset","byteLength","TextDecoder","fatal","ignoreBOM","skip","start","Varint","Bit64","Bit32","LengthDelimited","StartGroup","t","EndGroup","assertBounds","RangeError","int32","sint32","zze","int64","PbLong","uint64","PbULong","sint64","lo","hi","s","bool","fixed32","getUint32","sfixed32","getInt32","fixed64","sfixed64","float","getFloat32","double","getFloat64","string","decode","BinaryWriter","binaryWriteOptions","assert_1","defaultsWrite","writeUnknownFields","writerFactory","textEncoder","stack","TextEncoder","chunks","finish","offset","set","fork","chunk","prev","pop","type","varint32write","encode","setFloat32","setFloat64","setUint32","setInt32","long","from","varint64write","sign","listEnumNumbers","listEnumNames","listEnumValues","isEnumObject","hasOwnProperty","num","parseInt","isNaN","nam","enumObject","number","index","arr","int64toString","int64fromString","lowBits","highBits","mLine truncated
|
||||
{"version":3,"file":"index.js","names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","Object","defineProperty","exports","ClientStreamingCall","constructor","method","requestHeaders","request","headers","response","status","trailers","requests","onfulfilled","onrejected","promiseFinished","reason","all","Deferred","DeferredState","preventUnhandledRejectionWarning","_state","PENDING","_promise","_resolve","_reject","catch","_","state","promise","Error","toLowerCase","RESOLVED","REJECTED","resolvePending","val","rejectPending","DuplexStreamingCall","responses","__webpack_unused_export__","service_type_1","__webpack_require__","enumerable","get","ServiceType","reflection_info_1","readMethodOptions","readMethodOption","readServiceOption","rpc_error_1","RpcError","rpc_options_1","mergeRpcOptions","rpc_output_stream_1","RpcOutputStreamController","test_transport_1","TestTransport","deferred_1","duplex_streaming_call_1","client_streaming_call_1","server_streaming_call_1","ServerStreamingCall","unary_call_1","UnaryCall","rpc_interceptor_1","stackIntercept","stackDuplexStreamingInterceptors","stackClientStreamingInterceptors","stackServerStreamingInterceptors","stackUnaryInterceptors","server_call_context_1","ServerCallContextController","normalizeMethodInfo","runtime_1","service","_a","_b","_c","m","localName","lowerCamelCase","name","serverStreaming","clientStreaming","options","idempotency","undefined","methodName","extensionName","extensionType","methods","find","i","fromJson","optionVal","message","code","meta","super","setPrototypeOf","prototype","toString","l","push","serviceName","entries","length","k","v","join","kind","transport","input","_d","tail","mtd","inp","opt","unary","curr","interceptors","filter","interceptUnary","reverse","interceptServerStreaming","interceptClientStreaming","duplex","interceptDuplex","assertNever","defaults","o","copy","key","keys","jsonOptions","mergeJsonOptions","binaryOptions","mergeBinaryOptions","concat","a","into","c","Date","getTime","Array","isArray","_lis","nxt","msg","err","cmp","_closed","_itState","q","onNext","callback","addLis","onMessage","onError","onComplete","list","indexOf","splice","clearLis","values","closed","notifyNext","error","complete","assert","notifyMessage","notifyError","notifyComplete","pushIt","forEach","Symbol","asyncIterator","p","first","shift","deadline","sendResponseHeadersFn","defaultStatus","detail","_cancelled","_listeners","_sendRH","notifyCancelled","sendResponseHeaders","data","cancelled","onCancel","typeName","map","suppressUncaughtRejections","headerDelay","responseDelay","betweenResponseDelay","afterResponseDelay","sentMessages","lastInput","TestInputStream","sent","single","sendComplete","completed","promiseHeaders","defaultHeaders","promiseSingleResponse","r","O","create","is","streamResponses","stream","abort","messages","delay","promiseStatus","promiseTrailers","defaultTrailers","maybeSuppressUncaught","mergeOptions","headersPromise","responsePromise","statusPromise","trailersPromise","outputStream","responseStreamClosedPromise","responseHeader","responseTrailer","ms","aborted","id","setTimeout","addEventListener","ev","clearTimeout","_completed","_sent","send","inputMessage","delayMs","inputComplete","assertFloat32","assertUInt32","assertInt32","condition","FLOAT32_MAX","FLOAT32_MIN","UINT32_MAX","INT32_MAX","INT32_MIN","arg","Number","isInteger","isFinite","base64encode","base64decode","encTable","split","decTable","charCodeAt","base64Str","es","bytes","Uint8Array","bytePos","groupPos","b","subarray","base64","WireType","UnknownFieldHandler","symbol","for","onRead","fieldNo","wireType","container","no","onWrite","writer","tag","raw","uf","last","slice","assign","BinaryReader","binaryReadOptions","binary_format_contract_1","pb_long_1","goog_varint_1","defaultsRead","readUnknownField","readerFactory","buf","textDecoder","varint64","varint64read","uint32","varint32read","len","pos","view","DataView","buffer","byteOffset","byteLength","TextDecoder","fatal","ignoreBOM","skip","start","Varint","Bit64","Bit32","LengthDelimited","StartGroup","t","EndGroup","assertBounds","RangeError","int32","sint32","zze","int64","PbLong","uint64","PbULong","sint64","lo","hi","s","bool","fixed32","getUint32","sfixed32","getInt32","fixed64","sfixed64","float","getFloat32","double","getFloat64","string","decode","BinaryWriter","binaryWriteOptions","assert_1","defaultsWrite","writeUnknownFields","writerFactory","textEncoder","stack","TextEncoder","chunks","finish","offset","set","fork","chunk","prev","pop","type","varint32write","encode","setFloat32","setFloat64","setUint32","setInt32","long","from","varint64write","sign","listEnumNumbers","listEnumNames","listEnumValues","isEnumObject","hasOwnProperty","num","parseInt","isNaN","nam","enumObject","number","index","arr","int64toString","int64fromString","lowBits","highBits","mLine truncated
|
||||
+6
-4
@@ -42,24 +42,26 @@ export function getAuthList(inputs: Inputs): Array<Auth> {
|
||||
}
|
||||
let auths: Array<Auth> = [];
|
||||
if (!inputs.registryAuth) {
|
||||
const registry = inputs.registry || 'docker.io';
|
||||
auths.push({
|
||||
registry: inputs.registry || 'docker.io',
|
||||
registry,
|
||||
username: inputs.username,
|
||||
password: inputs.password,
|
||||
scope: inputs.scope,
|
||||
ecr: inputs.ecr || 'auto',
|
||||
configDir: scopeToConfigDir(inputs.registry, inputs.scope)
|
||||
configDir: scopeToConfigDir(registry, inputs.scope)
|
||||
});
|
||||
} else {
|
||||
auths = (yaml.load(inputs.registryAuth) as Array<Auth>).map(auth => {
|
||||
core.setSecret(auth.password); // redacted in workflow logs
|
||||
const registry = auth.registry || 'docker.io';
|
||||
return {
|
||||
registry: auth.registry || 'docker.io',
|
||||
registry,
|
||||
username: auth.username,
|
||||
password: auth.password,
|
||||
scope: auth.scope,
|
||||
ecr: auth.ecr || 'auto',
|
||||
configDir: scopeToConfigDir(auth.registry || 'docker.io', auth.scope)
|
||||
configDir: scopeToConfigDir(registry, auth.scope)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user