Compare commits

...

53 Commits
v2.0.0 ... v2

Author SHA1 Message Date
CrazyMax
465a07811f Merge pull request #524 from crazy-max/bump-aws
bump @aws-sdk/client-ecr and @aws-sdk/client-ecr-public to 3.347.1
2023-06-07 14:53:41 +02:00
CrazyMax
360b4b5fef Merge pull request #512 from jhihruei/change/update-gitlab-readme
readme: Add note to remind GitLab can use PAT
2023-06-07 11:20:05 +02:00
CrazyMax
c156700b23 update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-06-07 11:17:24 +02:00
CrazyMax
f605cf145e bump @aws-sdk/client-ecr and @aws-sdk/client-ecr-public to 3.347.1
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-06-07 11:16:50 +02:00
CrazyMax
2a93a3eddb Merge pull request #508 from docker/dependabot/npm_and_yarn/https-proxy-agent-7.0.0
build(deps): bump https-proxy-agent from 5.0.1 to 7.0.0
2023-06-07 11:09:19 +02:00
CrazyMax
422e90f610 update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-06-07 10:50:50 +02:00
dependabot[bot]
bc8c4d08b4 build(deps): bump https-proxy-agent from 5.0.1 to 7.0.0
Bumps [https-proxy-agent](https://github.com/TooTallNate/proxy-agents/tree/HEAD/packages/https-proxy-agent) from 5.0.1 to 7.0.0.
- [Release notes](https://github.com/TooTallNate/proxy-agents/releases)
- [Changelog](https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/CHANGELOG.md)
- [Commits](https://github.com/TooTallNate/proxy-agents/commits/https-proxy-agent@7.0.0/packages/https-proxy-agent)

---
updated-dependencies:
- dependency-name: https-proxy-agent
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 08:49:37 +00:00
CrazyMax
052c2c4268 Merge pull request #509 from docker/dependabot/npm_and_yarn/http-proxy-agent-7.0.0
build(deps): bump http-proxy-agent from 5.0.0 to 7.0.0
2023-06-07 10:48:39 +02:00
CrazyMax
beabccd65a update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-06-07 10:44:18 +02:00
dependabot[bot]
b56ed1c88d build(deps): bump http-proxy-agent from 5.0.0 to 7.0.0
Bumps [http-proxy-agent](https://github.com/TooTallNate/proxy-agents/tree/HEAD/packages/http-proxy-agent) from 5.0.0 to 7.0.0.
- [Release notes](https://github.com/TooTallNate/proxy-agents/releases)
- [Changelog](https://github.com/TooTallNate/proxy-agents/blob/main/packages/http-proxy-agent/CHANGELOG.md)
- [Commits](https://github.com/TooTallNate/proxy-agents/commits/http-proxy-agent@7.0.0/packages/http-proxy-agent)

---
updated-dependencies:
- dependency-name: http-proxy-agent
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 08:40:26 +00:00
CrazyMax
a13e198944 Merge pull request #476 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.2.0
build(deps): bump @docker/actions-toolkit from 0.1.0 to 0.2.0
2023-06-07 10:39:28 +02:00
CrazyMax
1b469c82ee Merge pull request #477 from docker/dependabot/github_actions/docker/bake-action-3
build(deps): bump docker/bake-action from 2 to 3
2023-06-07 10:38:08 +02:00
Hedgehog Chen
83e260592e readme: Add note to remind GitLab can use PAT
Signed-off-by: Hedgehog Chen <jhihruei@users.noreply.github.com>
2023-05-31 03:23:20 +08:00
dependabot[bot]
6ba7f31490 build(deps): bump docker/bake-action from 2 to 3
Bumps [docker/bake-action](https://github.com/docker/bake-action) from 2 to 3.
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](https://github.com/docker/bake-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/bake-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-19 05:58:19 +00:00
dependabot[bot]
5447726540 build(deps): bump @docker/actions-toolkit from 0.1.0 to 0.2.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-19 05:57:49 +00:00
CrazyMax
40891eba8c Merge pull request #470 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.1.0
build(deps): bump @docker/actions-toolkit from 0.1.0-beta.14 to 0.1.0
2023-04-17 09:32:20 +02:00
CrazyMax
dcd1f1fe0a update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-04-17 02:31:57 +02:00
CrazyMax
713d7298f6 update dev dependencies
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-04-17 02:27:30 +02:00
dependabot[bot]
a7ae18608a build(deps): bump @docker/actions-toolkit from 0.1.0-beta.14 to 0.1.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.1.0-beta.14 to 0.1.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.1.0-beta.14...v0.1.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-12 05:59:02 +00:00
CrazyMax
65b78e6e13 Merge pull request #423 from docker/dependabot/github_actions/aws-actions/configure-aws-credentials-2
Bump aws-actions/configure-aws-credentials from 1 to 2
2023-03-20 11:17:13 +00:00
CrazyMax
219c305e1c Merge pull request #429 from crazy-max/update-workflows
ci: split validate and test workflow
2023-03-15 15:20:16 +00:00
CrazyMax
eb81c74b31 ci: split validate and test workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-12 13:55:42 +01:00
dependabot[bot]
eb7654ec33 Bump aws-actions/configure-aws-credentials from 1 to 2
Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 1 to 2.
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/v1...v2)

---
updated-dependencies:
- dependency-name: aws-actions/configure-aws-credentials
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-07 05:58:15 +00:00
CrazyMax
ec9cdf07d5 Merge pull request #409 from crazy-max/switch-toolkit
switch to actions-toolkit implementation
2023-02-24 19:12:37 +01:00
CrazyMax
d01f5a4fd6 update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-24 10:16:56 +01:00
CrazyMax
af023e8f62 switch to actions-toolkit implementation
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-24 10:16:56 +01:00
CrazyMax
3da7dc6e2b Merge pull request #378 from docker/dependabot/npm_and_yarn/json5-2.2.3
Bump json5 from 2.2.0 to 2.2.3
2023-01-08 18:33:33 +01:00
dependabot[bot]
07119058a1 Bump json5 from 2.2.0 to 2.2.3
Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-07 04:54:58 +00:00
CrazyMax
bc135a1993 Merge pull request #363 from docker/dependabot/npm_and_yarn/aws-sdk/client-ecr-public-3.231.0
Bump @aws-sdk/client-ecr-public from 3.186.0 to 3.231.0
2022-12-19 20:45:11 +01:00
CrazyMax
f8374000f2 update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-12-19 20:43:31 +01:00
dependabot[bot]
9d3e51f876 Bump @aws-sdk/client-ecr-public from 3.186.0 to 3.231.0
Bumps [@aws-sdk/client-ecr-public](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecr-public) from 3.186.0 to 3.231.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-ecr-public/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.231.0/clients/client-ecr-public)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-ecr-public"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 19:37:48 +00:00
CrazyMax
9ec69b27e2 Merge pull request #364 from docker/dependabot/npm_and_yarn/aws-sdk/client-ecr-3.231.0
Bump @aws-sdk/client-ecr from 3.186.0 to 3.231.0
2022-12-19 20:36:49 +01:00
CrazyMax
7f58925139 readme: fix badges
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-12-19 20:34:47 +01:00
CrazyMax
980c90b31a update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-12-19 20:34:10 +01:00
dependabot[bot]
add9f8d32e Bump @aws-sdk/client-ecr from 3.186.0 to 3.231.0
Bumps [@aws-sdk/client-ecr](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecr) from 3.186.0 to 3.231.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-ecr/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.231.0/clients/client-ecr)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-ecr"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-15 05:03:58 +00:00
CrazyMax
f75d088332 Merge pull request #354 from docker/dependabot/npm_and_yarn/minimatch-3.1.2
Bump minimatch from 3.0.4 to 3.1.2
2022-11-29 18:58:25 +01:00
dependabot[bot]
b161681273 Bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 17:56:30 +00:00
CrazyMax
f4ef78c080 Merge pull request #299 from docker/dependabot/npm_and_yarn/aws-sdk/client-ecr-public-3.186.0
Bump @aws-sdk/client-ecr-public from 3.53.0 to 3.186.0
2022-10-07 19:46:23 +02:00
CrazyMax
9ad4ce3929 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-07 19:44:18 +02:00
dependabot[bot]
884eadd4f8 Bump @aws-sdk/client-ecr-public from 3.53.0 to 3.186.0
Bumps [@aws-sdk/client-ecr-public](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecr-public) from 3.53.0 to 3.186.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-ecr-public/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.186.0/clients/client-ecr-public)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-ecr-public"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-07 17:43:15 +00:00
CrazyMax
a266232f5c Merge pull request #298 from docker/dependabot/npm_and_yarn/aws-sdk/client-ecr-3.186.0
Bump @aws-sdk/client-ecr from 3.53.0 to 3.186.0
2022-10-07 19:41:49 +02:00
CrazyMax
f97efcfbf9 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-07 19:39:55 +02:00
dependabot[bot]
5ae789beac Bump @aws-sdk/client-ecr from 3.53.0 to 3.186.0
Bumps [@aws-sdk/client-ecr](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecr) from 3.53.0 to 3.186.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-ecr/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.186.0/clients/client-ecr)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-ecr"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-07 17:36:43 +00:00
CrazyMax
71c23b5b34 Merge pull request #292 from docker/dependabot/npm_and_yarn/actions/core-1.10.0
Bump @actions/core from 1.9.1 to 1.10.0
2022-10-07 19:35:19 +02:00
CrazyMax
6401d70aab Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-07 19:32:35 +02:00
dependabot[bot]
67e8909cc6 Bump @actions/core from 1.9.1 to 1.10.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.9.1 to 1.10.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-30 05:26:30 +00:00
Tõnis Tiigi
21f251affc Merge pull request #275 from crazy-max/redact-aws-creds
aws: ensure temp credentials redacted in workflow logs
2022-09-08 18:44:05 -07:00
CrazyMax
07cad18854 aws: ensure temp credentials redacted in workflow logs
Just for good measure and extra safety, redact temporary
credentials when aws authorization token is retrieved using
IAM authentication credentials to access Amazon ECR.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-09-09 00:05:45 +02:00
CrazyMax
be010b4293 Merge pull request #252 from docker/dependabot/npm_and_yarn/actions/core-1.9.1
Bump @actions/core from 1.6.0 to 1.9.1
2022-08-24 13:16:26 +02:00
CrazyMax
f719196635 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-08-24 12:32:26 +02:00
dependabot[bot]
9607a71381 Bump @actions/core from 1.6.0 to 1.9.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.6.0 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-09 05:15:53 +00:00
CrazyMax
d398f07826 Merge pull request #200 from crazy-max/update-refs
Bump all Docker actions to latest major
2022-05-05 19:45:44 +02:00
CrazyMax
31aab9fb7e Bump all Docker actions to latest major
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-05 19:36:43 +02:00
20 changed files with 5037 additions and 2176 deletions

View File

@@ -2,7 +2,7 @@
"env": {
"node": true,
"es2021": true,
"jest/globals": true
"jest": true
},
"extends": [
"eslint:recommended",

View File

@@ -143,7 +143,7 @@ jobs:
uses: actions/checkout@v3
-
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -190,7 +190,7 @@ jobs:
uses: actions/checkout@v3
-
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

View File

@@ -6,9 +6,6 @@ on:
- 'master'
- 'releases/v*'
pull_request:
branches:
- 'master'
- 'releases/v*'
jobs:
test:
@@ -17,14 +14,9 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Validate
uses: docker/bake-action@v1
with:
targets: validate
-
name: Test
uses: docker/bake-action@v1
uses: docker/bake-action@v3
with:
targets: test
-

41
.github/workflows/validate.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: validate
on:
push:
branches:
- 'master'
- 'releases/v*'
pull_request:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Targets matrix
id: targets
run: |
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
validate:
runs-on: ubuntu-latest
needs:
- prepare
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.prepare.outputs.targets) }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Validate
uses: docker/bake-action@v3
with:
targets: ${{ matrix.target }}

5
.gitignore vendored
View File

@@ -1,11 +1,6 @@
/.dev
node_modules/
lib
# Jetbrains
/.idea
/*.iml
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs

View File

@@ -1,7 +1,7 @@
[![GitHub release](https://img.shields.io/github/release/docker/login-action.svg?style=flat-square)](https://github.com/docker/login-action/releases/latest)
[![GitHub marketplace](https://img.shields.io/badge/marketplace-docker--login-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/docker-login)
[![CI workflow](https://img.shields.io/github/workflow/status/docker/login-action/ci?label=ci&logo=github&style=flat-square)](https://github.com/docker/login-action/actions?workflow=ci)
[![Test workflow](https://img.shields.io/github/workflow/status/docker/login-action/test?label=test&logo=github&style=flat-square)](https://github.com/docker/login-action/actions?workflow=test)
[![CI workflow](https://img.shields.io/github/actions/workflow/status/docker/login-action/ci.yml?branch=master&label=ci&logo=github&style=flat-square)](https://github.com/docker/login-action/actions?workflow=ci)
[![Test workflow](https://img.shields.io/github/actions/workflow/status/docker/login-action/test.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/docker/login-action/actions?workflow=test)
[![Codecov](https://img.shields.io/codecov/c/github/docker/login-action?logo=codecov&style=flat-square)](https://codecov.io/gh/docker/login-action)
## About
@@ -47,7 +47,7 @@ jobs:
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -72,7 +72,7 @@ jobs:
steps:
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -100,13 +100,15 @@ jobs:
steps:
-
name: Login to GitLab
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: registry.gitlab.com
username: ${{ secrets.GITLAB_USERNAME }}
password: ${{ secrets.GITLAB_PASSWORD }}
```
If you have [Two-Factor Authentication](https://gitlab.com/help/user/profile/account/two_factor_authentication) enabled, use a [Personal Access Token](https://gitlab.com/help/user/profile/personal_access_tokens) instead of a password.
### Azure Container Registry (ACR)
[Create a service principal](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-service-principal#create-a-service-principal)
@@ -126,7 +128,7 @@ jobs:
steps:
-
name: Login to ACR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: <registry-name>.azurecr.io
username: ${{ secrets.AZURE_CLIENT_ID }}
@@ -168,7 +170,7 @@ jobs:
service_account: '<service_account>'
- name: Login to GCR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: gcr.io
username: oauth2accesstoken
@@ -200,7 +202,7 @@ jobs:
steps:
-
name: Login to GCR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: gcr.io
username: _json_key
@@ -235,7 +237,7 @@ jobs:
service_account: '<service_account>'
- name: Login to GAR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: <location>-docker.pkg.dev
username: oauth2accesstoken
@@ -269,7 +271,7 @@ jobs:
steps:
-
name: Login to GAR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: <location>-docker.pkg.dev
username: _json_key
@@ -298,7 +300,7 @@ jobs:
steps:
-
name: Login to ECR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: <aws-account-number>.dkr.ecr.<region>.amazonaws.com
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -321,7 +323,7 @@ jobs:
steps:
-
name: Login to ECR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: <aws-account-number>.dkr.ecr.<region>.amazonaws.com
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -355,7 +357,7 @@ jobs:
aws-region: <region>
-
name: Login to ECR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: <aws-account-number>.dkr.ecr.<region>.amazonaws.com
```
@@ -381,7 +383,7 @@ jobs:
steps:
-
name: Login to Public ECR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -415,7 +417,7 @@ jobs:
steps:
-
name: Login to OCIR
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: <region>.ocir.io
username: ${{ secrets.OCI_USERNAME }}
@@ -441,7 +443,7 @@ jobs:
steps:
-
name: Login to Quay.io
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}

View File

@@ -7,5 +7,5 @@ test('with password and username getInputs does not throw error', async () => {
process.env['INPUT_LOGOUT'] = 'true';
expect(() => {
getInputs();
}).not.toThrowError();
}).not.toThrow();
});

View File

@@ -1,26 +1,21 @@
import {expect, jest, test} from '@jest/globals';
import osm = require('os');
import {run} from '../src/main';
import {main} from '../src/main';
import * as docker from '../src/docker';
import * as stateHelper from '../src/state-helper';
import * as core from '@actions/core';
test('errors without username and password', async () => {
jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
process.env['INPUT_LOGOUT'] = 'true'; // default value
const coreSpy = jest.spyOn(core, 'setFailed');
await run();
expect(coreSpy).toHaveBeenCalledWith('Username and password required');
await expect(main()).rejects.toThrow(new Error('Username and password required'));
});
test('successful with username and password', async () => {
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 dockerSpy = jest.spyOn(docker, 'login').mockImplementation(() => Promise.resolve());
const username = 'dbowie';
process.env[`INPUT_USERNAME`] = username;
@@ -34,7 +29,7 @@ test('successful with username and password', async () => {
const logout = false;
process.env['INPUT_LOGOUT'] = String(logout);
await run();
await main();
expect(setRegistrySpy).toHaveBeenCalledWith('');
expect(setLogoutSpy).toHaveBeenCalledWith(logout);
@@ -45,8 +40,7 @@ test('calls docker login', async () => {
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 dockerSpy = jest.spyOn(docker, 'login').mockImplementation(() => Promise.resolve());
const username = 'dbowie';
process.env[`INPUT_USERNAME`] = username;
@@ -63,7 +57,7 @@ test('calls docker login', async () => {
const logout = true;
process.env['INPUT_LOGOUT'] = String(logout);
await run();
await main();
expect(setRegistrySpy).toHaveBeenCalledWith(registry);
expect(setLogoutSpy).toHaveBeenCalledWith(logout);

4
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

3140
dist/licenses.txt generated vendored

File diff suppressed because it is too large Load Diff

2
dist/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,29 @@
import fs from 'fs';
import os from 'os';
import path from 'path';
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-login-action-')).split(path.sep).join(path.posix.sep);
process.env = Object.assign({}, process.env, {
TEMP: tmpDir,
GITHUB_REPOSITORY: 'docker/login-action',
RUNNER_TEMP: path.join(tmpDir, 'runner-temp').split(path.sep).join(path.posix.sep),
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache').split(path.sep).join(path.posix.sep)
}) as {
[key: string]: string;
};
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
setupFiles: ["dotenv/config"],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.ts$': 'ts-jest'
},
moduleNameMapper: {
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
},
collectCoverageFrom: ['src/**/{!(main.ts),}.ts'],
coveragePathIgnorePatterns: ['lib/', 'node_modules/', '__tests__/'],
verbose: true
}
};

View File

@@ -27,28 +27,26 @@
],
"license": "MIT",
"dependencies": {
"@actions/core": "^1.6.0",
"@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.1"
"@actions/core": "^1.10.0",
"@aws-sdk/client-ecr": "^3.347.1",
"@aws-sdk/client-ecr-public": "^3.347.1",
"@docker/actions-toolkit": "^0.2.0",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.0"
},
"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.3.1",
"ts-jest": "^27.1.2",
"ts-node": "^10.7.0",
"typescript": "^4.4.4"
"@types/node": "^16.18.21",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"@vercel/ncc": "^0.36.1",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.5.0",
"prettier": "^2.8.7",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
}
}

View File

@@ -96,6 +96,8 @@ export const getRegistriesData = async (registry: string, username?: string, pas
}
const authToken = Buffer.from(authTokenResponse.authorizationData.authorizationToken, 'base64').toString('utf-8');
const creds = authToken.split(':', 2);
core.setSecret(creds[0]); // redacted in workflow logs
core.setSecret(creds[1]); // redacted in workflow logs
return [
{
registry: 'public.ecr.aws',
@@ -122,6 +124,8 @@ export const getRegistriesData = async (registry: string, username?: string, pas
for (const authData of authTokenResponse.authorizationData) {
const authToken = Buffer.from(authData.authorizationToken || '', 'base64').toString('utf-8');
const creds = authToken.split(':', 2);
core.setSecret(creds[0]); // redacted in workflow logs
core.setSecret(creds[1]); // redacted in workflow logs
regDatas.push({
registry: authData.proxyEndpoint || '',
username: creds[0],

View File

@@ -1,6 +1,6 @@
import * as aws from './aws';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import {Exec} from '@docker/actions-toolkit/lib/exec';
export async function login(registry: string, username: string, password: string, ecr: string): Promise<void> {
if (/true/i.test(ecr) || (ecr == 'auto' && aws.isECR(registry))) {
@@ -11,15 +11,13 @@ export async function login(registry: string, username: string, password: string
}
export async function logout(registry: string): Promise<void> {
await exec
.getExecOutput('docker', ['logout', registry], {
ignoreReturnCode: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(res.stderr.trim());
}
});
await Exec.getExecOutput('docker', ['logout', registry], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(res.stderr.trim());
}
});
}
export async function loginStandard(registry: string, username: string, password: string): Promise<void> {
@@ -36,18 +34,16 @@ export async function loginStandard(registry: string, username: string, password
} else {
core.info(`Logging into Docker Hub...`);
}
await exec
.getExecOutput('docker', loginArgs, {
ignoreReturnCode: true,
silent: true,
input: Buffer.from(password)
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
}
core.info(`Login Succeeded!`);
});
await Exec.getExecOutput('docker', loginArgs, {
ignoreReturnCode: true,
silent: true,
input: Buffer.from(password)
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
}
core.info(`Login Succeeded!`);
});
}
export async function loginECR(registry: string, username: string, password: string): Promise<void> {
@@ -55,17 +51,15 @@ export async function loginECR(registry: string, username: string, password: str
const regDatas = await aws.getRegistriesData(registry, username, password);
for (const regData of regDatas) {
core.info(`Logging into ${regData.registry}...`);
await exec
.getExecOutput('docker', ['login', '--password-stdin', '--username', regData.username, regData.registry], {
ignoreReturnCode: true,
silent: true,
input: Buffer.from(regData.password)
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
}
core.info('Login Succeeded!');
});
await Exec.getExecOutput('docker', ['login', '--password-stdin', '--username', regData.username, regData.registry], {
ignoreReturnCode: true,
silent: true,
input: Buffer.from(regData.password)
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
}
core.info('Login Succeeded!');
});
}
}

View File

@@ -1,28 +1,21 @@
import * as core from '@actions/core';
import * as actionsToolkit from '@docker/actions-toolkit';
import * as context from './context';
import * as docker from './docker';
import * as stateHelper from './state-helper';
export async function run(): Promise<void> {
try {
const input: context.Inputs = context.getInputs();
stateHelper.setRegistry(input.registry);
stateHelper.setLogout(input.logout);
await docker.login(input.registry, input.username, input.password, input.ecr);
} catch (error) {
core.setFailed(error.message);
}
export async function main(): Promise<void> {
const input: context.Inputs = context.getInputs();
stateHelper.setRegistry(input.registry);
stateHelper.setLogout(input.logout);
await docker.login(input.registry, input.username, input.password, input.ecr);
}
async function logout(): Promise<void> {
async function post(): Promise<void> {
if (!stateHelper.logout) {
return;
}
await docker.logout(stateHelper.registry);
}
if (!stateHelper.IsPost) {
run();
} else {
logout();
}
actionsToolkit.run(main, post);

View File

@@ -1,6 +1,5 @@
import * as core from '@actions/core';
export const IsPost = !!process.env['STATE_isPost'];
export const registry = process.env['STATE_registry'] || '';
export const logout = /true/i.test(process.env['STATE_logout'] || '');
@@ -11,7 +10,3 @@ export function setRegistry(registry: string) {
export function setLogout(logout: boolean) {
core.saveState('logout', logout);
}
if (!IsPost) {
core.saveState('isPost', 'true');
}

View File

@@ -1,19 +1,21 @@
{
"compilerOptions": {
"esModuleInterop": true,
"target": "es6",
"module": "commonjs",
"strict": true,
"newLine": "lf",
"outDir": "./lib",
"rootDir": "./src",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": false,
"resolveJsonModule": true,
"useUnknownInCatchVariables": false,
},
"exclude": [
"./__tests__/**/*",
"./lib/**/*",
"node_modules",
"**/*.test.ts",
"jest.config.ts"
]
}

3782
yarn.lock

File diff suppressed because it is too large Load Diff