Compare commits
	
		
			18 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					49ed152c8e | ||
| 
						 | 
					b61a9ce7bd | ||
| 
						 | 
					3a136a8631 | ||
| 
						 | 
					b312880b69 | ||
| 
						 | 
					795794e081 | ||
| 
						 | 
					1edf6180e0 | ||
| 
						 | 
					8e66ad4089 | ||
| 
						 | 
					7c79b598ea | ||
| 
						 | 
					24a38e0d6d | ||
| 
						 | 
					70e1ff84cb | ||
| 
						 | 
					0828e0e718 | ||
| 
						 | 
					56f72fcef0 | ||
| 
						 | 
					f169e16aaa | ||
| 
						 | 
					fa178e4710 | ||
| 
						 | 
					a4bf4e934e | ||
| 
						 | 
					2bbd6e81e1 | ||
| 
						 | 
					f6d32ad023 | ||
| 
						 | 
					b4595c8bf9 | 
							
								
								
									
										23
									
								
								.eslintrc.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								.eslintrc.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
{
 | 
			
		||||
  "env": {
 | 
			
		||||
    "node": true,
 | 
			
		||||
    "es2021": true,
 | 
			
		||||
    "jest/globals": true
 | 
			
		||||
  },
 | 
			
		||||
  "extends": [
 | 
			
		||||
    "eslint:recommended",
 | 
			
		||||
    "plugin:@typescript-eslint/recommended",
 | 
			
		||||
    "plugin:jest/recommended",
 | 
			
		||||
    "plugin:prettier/recommended"
 | 
			
		||||
  ],
 | 
			
		||||
  "parser": "@typescript-eslint/parser",
 | 
			
		||||
  "parserOptions": {
 | 
			
		||||
    "ecmaVersion": "latest",
 | 
			
		||||
    "sourceType": "module"
 | 
			
		||||
  },
 | 
			
		||||
  "plugins": [
 | 
			
		||||
    "@typescript-eslint",
 | 
			
		||||
    "jest",
 | 
			
		||||
    "prettier"
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										26
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@@ -15,7 +15,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Stop docker
 | 
			
		||||
        run: |
 | 
			
		||||
@@ -39,7 +39,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to GitHub Container Registry
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -56,7 +56,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to GitHub Container Registry
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -81,7 +81,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to ACR
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -101,7 +101,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to Docker Hub
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -120,7 +120,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to ECR
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -140,7 +140,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Configure AWS Credentials
 | 
			
		||||
        uses: aws-actions/configure-aws-credentials@v1
 | 
			
		||||
@@ -165,7 +165,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to Public ECR
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -187,7 +187,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Configure AWS Credentials
 | 
			
		||||
        uses: aws-actions/configure-aws-credentials@v1
 | 
			
		||||
@@ -212,7 +212,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to GitHub Container Registry
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -232,7 +232,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to GitLab
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -252,7 +252,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to Google Artifact Registry
 | 
			
		||||
        uses: ./
 | 
			
		||||
@@ -272,7 +272,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Login to Google Container Registry
 | 
			
		||||
        uses: ./
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							@@ -16,7 +16,7 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      -
 | 
			
		||||
        name: Validate
 | 
			
		||||
        uses: docker/bake-action@v1
 | 
			
		||||
@@ -29,6 +29,6 @@ jobs:
 | 
			
		||||
          targets: test
 | 
			
		||||
      -
 | 
			
		||||
        name: Upload coverage
 | 
			
		||||
        uses: codecov/codecov-action@v2
 | 
			
		||||
        uses: codecov/codecov-action@v3
 | 
			
		||||
        with:
 | 
			
		||||
          file: ./coverage/clover.xml
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,7 @@ import * as exec from '@actions/exec';
 | 
			
		||||
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 = jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
 | 
			
		||||
    return {
 | 
			
		||||
@@ -15,9 +16,9 @@ test('loginStandard calls exec', async () => {
 | 
			
		||||
    };
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const username: string = 'dbowie';
 | 
			
		||||
  const password: string = 'groundcontrol';
 | 
			
		||||
  const registry: string = 'https://ghcr.io';
 | 
			
		||||
  const username = 'dbowie';
 | 
			
		||||
  const password = 'groundcontrol';
 | 
			
		||||
  const registry = 'https://ghcr.io';
 | 
			
		||||
 | 
			
		||||
  await loginStandard(registry, username, password);
 | 
			
		||||
 | 
			
		||||
@@ -29,6 +30,7 @@ test('loginStandard calls exec', async () => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('logout calls exec', async () => {
 | 
			
		||||
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
 | 
			
		||||
  // @ts-ignore
 | 
			
		||||
  const execSpy = jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
 | 
			
		||||
    return {
 | 
			
		||||
@@ -38,7 +40,7 @@ test('logout calls exec', async () => {
 | 
			
		||||
    };
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const registry: string = 'https://ghcr.io';
 | 
			
		||||
  const registry = 'https://ghcr.io';
 | 
			
		||||
 | 
			
		||||
  await logout(registry);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,7 @@ import * as stateHelper from '../src/state-helper';
 | 
			
		||||
import * as core from '@actions/core';
 | 
			
		||||
 | 
			
		||||
test('errors without username and password', async () => {
 | 
			
		||||
  const platSpy = jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
 | 
			
		||||
 | 
			
		||||
  jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
 | 
			
		||||
  process.env['INPUT_LOGOUT'] = 'true'; // default value
 | 
			
		||||
  const coreSpy = jest.spyOn(core, 'setFailed');
 | 
			
		||||
 | 
			
		||||
@@ -18,21 +17,21 @@ test('errors without username and password', async () => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('successful with username and password', async () => {
 | 
			
		||||
  const platSpy = jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
 | 
			
		||||
  jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
 | 
			
		||||
  const setRegistrySpy = jest.spyOn(stateHelper, 'setRegistry');
 | 
			
		||||
  const setLogoutSpy = jest.spyOn(stateHelper, 'setLogout');
 | 
			
		||||
  const dockerSpy = jest.spyOn(docker, 'login').mockImplementation(jest.fn());
 | 
			
		||||
 | 
			
		||||
  const username: string = 'dbowie';
 | 
			
		||||
  const username = 'dbowie';
 | 
			
		||||
  process.env[`INPUT_USERNAME`] = username;
 | 
			
		||||
 | 
			
		||||
  const password: string = 'groundcontrol';
 | 
			
		||||
  const password = 'groundcontrol';
 | 
			
		||||
  process.env[`INPUT_PASSWORD`] = password;
 | 
			
		||||
 | 
			
		||||
  const ecr: string = 'auto';
 | 
			
		||||
  const ecr = 'auto';
 | 
			
		||||
  process.env['INPUT_ECR'] = ecr;
 | 
			
		||||
 | 
			
		||||
  const logout: boolean = false;
 | 
			
		||||
  const logout = false;
 | 
			
		||||
  process.env['INPUT_LOGOUT'] = String(logout);
 | 
			
		||||
 | 
			
		||||
  await run();
 | 
			
		||||
@@ -43,25 +42,25 @@ test('successful with username and password', async () => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('calls docker login', async () => {
 | 
			
		||||
  const platSpy = jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
 | 
			
		||||
  jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
 | 
			
		||||
  const setRegistrySpy = jest.spyOn(stateHelper, 'setRegistry');
 | 
			
		||||
  const setLogoutSpy = jest.spyOn(stateHelper, 'setLogout');
 | 
			
		||||
  const dockerSpy = jest.spyOn(docker, 'login');
 | 
			
		||||
  dockerSpy.mockImplementation(jest.fn());
 | 
			
		||||
 | 
			
		||||
  const username: string = 'dbowie';
 | 
			
		||||
  const username = 'dbowie';
 | 
			
		||||
  process.env[`INPUT_USERNAME`] = username;
 | 
			
		||||
 | 
			
		||||
  const password: string = 'groundcontrol';
 | 
			
		||||
  const password = 'groundcontrol';
 | 
			
		||||
  process.env[`INPUT_PASSWORD`] = password;
 | 
			
		||||
 | 
			
		||||
  const registry: string = 'ghcr.io';
 | 
			
		||||
  const registry = 'ghcr.io';
 | 
			
		||||
  process.env[`INPUT_REGISTRY`] = registry;
 | 
			
		||||
 | 
			
		||||
  const ecr: string = 'auto';
 | 
			
		||||
  const ecr = 'auto';
 | 
			
		||||
  process.env['INPUT_ECR'] = ecr;
 | 
			
		||||
 | 
			
		||||
  const logout: boolean = true;
 | 
			
		||||
  const logout = true;
 | 
			
		||||
  process.env['INPUT_LOGOUT'] = String(logout);
 | 
			
		||||
 | 
			
		||||
  await run();
 | 
			
		||||
 
 | 
			
		||||
@@ -26,6 +26,6 @@ inputs:
 | 
			
		||||
    required: false
 | 
			
		||||
 | 
			
		||||
runs:
 | 
			
		||||
  using: 'node12'
 | 
			
		||||
  using: 'node16'
 | 
			
		||||
  main: 'dist/index.js'
 | 
			
		||||
  post: 'dist/index.js'
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
# syntax=docker/dockerfile:1.3-labs
 | 
			
		||||
# syntax=docker/dockerfile:1
 | 
			
		||||
 | 
			
		||||
ARG NODE_VERSION=12
 | 
			
		||||
ARG DOCKER_VERSION=20.10.10
 | 
			
		||||
ARG BUILDX_VERSION=0.7.0
 | 
			
		||||
ARG NODE_VERSION=16
 | 
			
		||||
ARG DOCKER_VERSION=20.10.13
 | 
			
		||||
ARG BUILDX_VERSION=0.8.1
 | 
			
		||||
 | 
			
		||||
FROM node:${NODE_VERSION}-alpine AS base
 | 
			
		||||
RUN apk add --no-cache cpio findutils git
 | 
			
		||||
@@ -57,10 +57,10 @@ RUN --mount=type=bind,target=.,rw \
 | 
			
		||||
FROM scratch AS format-update
 | 
			
		||||
COPY --from=format /out /
 | 
			
		||||
 | 
			
		||||
FROM deps AS format-validate
 | 
			
		||||
FROM deps AS lint
 | 
			
		||||
RUN --mount=type=bind,target=.,rw \
 | 
			
		||||
  --mount=type=cache,target=/src/node_modules \
 | 
			
		||||
  yarn run format-check
 | 
			
		||||
  yarn run lint
 | 
			
		||||
 | 
			
		||||
FROM docker:${DOCKER_VERSION} as docker
 | 
			
		||||
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										32412
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										32412
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										9468
									
								
								dist/licenses.txt
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9468
									
								
								dist/licenses.txt
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1
									
								
								dist/sourcemap-register.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								dist/sourcemap-register.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -7,7 +7,7 @@ group "pre-checkin" {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
group "validate" {
 | 
			
		||||
  targets = ["format-validate", "build-validate", "vendor-validate"]
 | 
			
		||||
  targets = ["lint", "build-validate", "vendor-validate"]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
target "build" {
 | 
			
		||||
@@ -28,9 +28,9 @@ target "format" {
 | 
			
		||||
  output = ["."]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
target "format-validate" {
 | 
			
		||||
target "lint" {
 | 
			
		||||
  dockerfile = "dev.Dockerfile"
 | 
			
		||||
  target = "format-validate"
 | 
			
		||||
  target = "lint"
 | 
			
		||||
  output = ["type=cacheonly"]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,5 +6,5 @@ module.exports = {
 | 
			
		||||
  transform: {
 | 
			
		||||
    '^.+\\.ts$': 'ts-jest'
 | 
			
		||||
  },
 | 
			
		||||
  verbose: false
 | 
			
		||||
  verbose: true
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								package.json
									
									
									
									
									
								
							@@ -3,11 +3,11 @@
 | 
			
		||||
  "description": "GitHub Action to login against a Docker registry",
 | 
			
		||||
  "main": "lib/main.js",
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "build": "tsc && ncc build",
 | 
			
		||||
    "format": "prettier --write '**/*.ts'",
 | 
			
		||||
    "format-check": "prettier --check '**/*.ts'",
 | 
			
		||||
    "build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
 | 
			
		||||
    "lint": "eslint src/**/*.ts __tests__/**/*.ts",
 | 
			
		||||
    "format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
 | 
			
		||||
    "test": "jest --coverage",
 | 
			
		||||
    "pre-checkin": "yarn run format && yarn run build"
 | 
			
		||||
    "all": "yarn run build && yarn run format && yarn test"
 | 
			
		||||
  },
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
@@ -28,20 +28,27 @@
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@actions/core": "^1.6.0",
 | 
			
		||||
    "@actions/exec": "^1.1.0",
 | 
			
		||||
    "@actions/io": "^1.1.1",
 | 
			
		||||
    "@actions/exec": "^1.1.1",
 | 
			
		||||
    "@actions/io": "^1.1.2",
 | 
			
		||||
    "@aws-sdk/client-ecr": "^3.53.0",
 | 
			
		||||
    "@aws-sdk/client-ecr-public": "^3.53.0",
 | 
			
		||||
    "http-proxy-agent": "^5.0.0",
 | 
			
		||||
    "https-proxy-agent": "^5.0.0"
 | 
			
		||||
    "https-proxy-agent": "^5.0.1"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/node": "^16.11.26",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "^5.14.0",
 | 
			
		||||
    "@typescript-eslint/parser": "^5.14.0",
 | 
			
		||||
    "@vercel/ncc": "^0.33.3",
 | 
			
		||||
    "dotenv": "^16.0.0",
 | 
			
		||||
    "eslint": "^8.11.0",
 | 
			
		||||
    "eslint-config-prettier": "^8.5.0",
 | 
			
		||||
    "eslint-plugin-jest": "^26.1.1",
 | 
			
		||||
    "eslint-plugin-prettier": "^4.0.0",
 | 
			
		||||
    "jest": "^27.2.5",
 | 
			
		||||
    "prettier": "^2.5.1",
 | 
			
		||||
    "prettier": "^2.3.1",
 | 
			
		||||
    "ts-jest": "^27.1.2",
 | 
			
		||||
    "ts-node": "^10.7.0",
 | 
			
		||||
    "typescript": "^4.4.4"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ export const getAccountIDs = (registry: string): string[] => {
 | 
			
		||||
  if (!matches) {
 | 
			
		||||
    return [];
 | 
			
		||||
  }
 | 
			
		||||
  let accountIDs: Array<string> = [matches[2]];
 | 
			
		||||
  const accountIDs: Array<string> = [matches[2]];
 | 
			
		||||
  if (process.env.AWS_ACCOUNT_IDS) {
 | 
			
		||||
    accountIDs.push(...process.env.AWS_ACCOUNT_IDS.split(','));
 | 
			
		||||
  }
 | 
			
		||||
@@ -57,14 +57,14 @@ export const getRegistriesData = async (registry: string, username?: string, pas
 | 
			
		||||
    authTokenRequest['registryIds'] = accountIDs;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  let httpProxyAgent: any = null;
 | 
			
		||||
  let httpProxyAgent;
 | 
			
		||||
  const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY || '';
 | 
			
		||||
  if (httpProxy) {
 | 
			
		||||
    core.debug(`Using http proxy ${httpProxy}`);
 | 
			
		||||
    httpProxyAgent = new HttpProxyAgent(httpProxy);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  let httpsProxyAgent: any = null;
 | 
			
		||||
  let httpsProxyAgent;
 | 
			
		||||
  const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY || '';
 | 
			
		||||
  if (httpsProxy) {
 | 
			
		||||
    core.debug(`Using https proxy ${httpsProxy}`);
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ export async function loginStandard(registry: string, username: string, password
 | 
			
		||||
    throw new Error('Username and password required');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  let loginArgs: Array<string> = ['login', '--password-stdin'];
 | 
			
		||||
  const loginArgs: Array<string> = ['login', '--password-stdin'];
 | 
			
		||||
  loginArgs.push('--username', username);
 | 
			
		||||
  loginArgs.push(registry);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ export async function run(): Promise<void> {
 | 
			
		||||
    stateHelper.setRegistry(input.registry);
 | 
			
		||||
    stateHelper.setLogout(input.logout);
 | 
			
		||||
    await docker.login(input.registry, input.username, input.password, input.ecr);
 | 
			
		||||
  } catch (error: any) {
 | 
			
		||||
  } catch (error) {
 | 
			
		||||
    core.setFailed(error.message);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,19 @@
 | 
			
		||||
{
 | 
			
		||||
  "compilerOptions": {
 | 
			
		||||
    "target": "esnext",
 | 
			
		||||
    "target": "es6",
 | 
			
		||||
    "module": "commonjs",
 | 
			
		||||
    "newLine": "lf",
 | 
			
		||||
    "outDir": "./lib",
 | 
			
		||||
    "rootDir": "./src",
 | 
			
		||||
    "esModuleInterop": true,
 | 
			
		||||
    "forceConsistentCasingInFileNames": true,
 | 
			
		||||
    "strict": true,
 | 
			
		||||
    "noImplicitAny": false,
 | 
			
		||||
    "esModuleInterop": true,
 | 
			
		||||
    "sourceMap": true
 | 
			
		||||
    "useUnknownInCatchVariables": false,
 | 
			
		||||
  },
 | 
			
		||||
  "exclude": ["node_modules", "**/*.test.ts"]
 | 
			
		||||
  "exclude": [
 | 
			
		||||
    "node_modules",
 | 
			
		||||
    "**/*.test.ts",
 | 
			
		||||
    "jest.config.ts"
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user