Compare commits

...

93 Commits
v1.12.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
CrazyMax
49ed152c8e Merge pull request #161 from crazy-max/node16-runtime
Node 16 as default runtime
2022-05-05 18:59:26 +02:00
CrazyMax
b61a9ce7bd Node 16 as default runtime
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 15:17:49 +02:00
CrazyMax
3a136a8631 Merge pull request #182 from docker/dependabot/npm_and_yarn/https-proxy-agent-5.0.1
Bump https-proxy-agent from 5.0.0 to 5.0.1
2022-04-28 07:51:49 +02:00
CrazyMax
b312880b69 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-04-28 07:50:23 +02:00
dependabot[bot]
795794e081 Bump https-proxy-agent from 5.0.0 to 5.0.1
Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases)
- [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/5.0.0...5.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-15 05:15:24 +00:00
CrazyMax
1edf6180e0 Merge pull request #179 from docker/dependabot/github_actions/codecov/codecov-action-3
Bump codecov/codecov-action from 2 to 3
2022-04-12 13:18:35 +02:00
dependabot[bot]
8e66ad4089 Bump codecov/codecov-action from 2 to 3
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 05:12:12 +00:00
CrazyMax
7c79b598ea Merge pull request #176 from docker/dependabot/npm_and_yarn/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6
2022-03-28 15:57:28 +02:00
dependabot[bot]
24a38e0d6d Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-27 13:30:24 +00:00
CrazyMax
70e1ff84cb Merge pull request #170 from crazy-max/eslint
dev: switch to eslint
2022-03-21 11:01:12 +01:00
CrazyMax
0828e0e718 dev: switch to eslint
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-21 10:58:19 +01:00
CrazyMax
56f72fcef0 dev: update bins and frontend
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-21 10:58:18 +01:00
CrazyMax
f169e16aaa Merge pull request #168 from docker/dependabot/npm_and_yarn/actions/io-1.1.2
Bump @actions/io from 1.1.1 to 1.1.2
2022-03-21 09:18:08 +01:00
dependabot[bot]
fa178e4710 Bump @actions/io from 1.1.1 to 1.1.2
Bumps [@actions/io](https://github.com/actions/toolkit/tree/HEAD/packages/io) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/io/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/io)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 08:15:07 +00:00
CrazyMax
a4bf4e934e Merge pull request #167 from docker/dependabot/npm_and_yarn/actions/exec-1.1.1
Bump @actions/exec from 1.1.0 to 1.1.1
2022-03-21 09:12:58 +01:00
dependabot[bot]
2bbd6e81e1 Bump @actions/exec from 1.1.0 to 1.1.1
Bumps [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/exec/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/tool-cache@1.1.1/packages/exec)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 05:14:07 +00:00
CrazyMax
f6d32ad023 Merge pull request #162 from docker/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-03-02 07:24:37 +01:00
dependabot[bot]
b4595c8bf9 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 05:15:17 +00:00
CrazyMax
dd4fa0671b Merge pull request #160 from crazy-max/node12
Revert to Node 12 as default runtime
2022-03-01 20:54:30 +01:00
CrazyMax
4e3538592e Revert to Node 12 as default runtime
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-01 20:51:18 +01:00
CrazyMax
bb984efc56 Merge pull request #156 from docker/dependabot/npm_and_yarn/aws-sdk/client-ecr-public-3.53.0
Bump @aws-sdk/client-ecr-public from 3.45.0 to 3.53.0
2022-02-28 09:04:17 +01:00
CrazyMax
722888132b Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-28 08:54:17 +01:00
dependabot[bot]
17780b56b7 Bump @aws-sdk/client-ecr-public from 3.45.0 to 3.53.0
Bumps [@aws-sdk/client-ecr-public](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecr-public) from 3.45.0 to 3.53.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.53.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-02-28 07:53:18 +00:00
CrazyMax
39857b3b45 Merge pull request #157 from docker/dependabot/npm_and_yarn/aws-sdk/client-ecr-3.53.0
Bump @aws-sdk/client-ecr from 3.45.0 to 3.53.0
2022-02-28 08:51:21 +01:00
CrazyMax
5fcc728422 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-28 08:49:13 +01:00
dependabot[bot]
9fb8721eb9 Bump @aws-sdk/client-ecr from 3.45.0 to 3.53.0
Bumps [@aws-sdk/client-ecr](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecr) from 3.45.0 to 3.53.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.53.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-02-28 07:45:26 +00:00
CrazyMax
4e3c9375bb Merge pull request #158 from crazy-max/node-16
update to node 16
2022-02-28 08:43:40 +01:00
CrazyMax
4b59a429db update to node 16
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-28 08:29:00 +01:00
CrazyMax
6af3c118c8 Merge pull request #152 from crazy-max/aws-sdk-proxy
handle proxy settings for aws-sdk
2022-02-17 11:30:34 +01:00
CrazyMax
caca3368ce handle proxy settings for aws-sdk
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-16 13:53:16 +01:00
CrazyMax
17f28ab24d Merge pull request #112 from dineshba/workload-identity-gcr-gar
Update readme with workload identity based authentication for GCR and GAR
2022-02-03 17:48:36 +01:00
Dinesh B
a875dd0e21 Update readme with workload identity based authentication for GCR and GAR
Signed-off-by: Dinesh B <dineshudt17@gmail.com>
Signed-off-by: Dinesh <dineshb@thoughtworks.com>
2022-02-03 20:57:42 +05:30
CrazyMax
7948fffc49 Merge pull request #49 from crazy-max/e2e-acr
Test login against ACR
2022-01-27 13:07:02 +01:00
CrazyMax
5fcefb941d Merge pull request #131 from docker/dependabot/npm_and_yarn/aws-sdk/client-ecr-public-3.45.0
Bump @aws-sdk/client-ecr-public from 3.43.0 to 3.45.0
2021-12-30 20:49:49 +01:00
CrazyMax
3bb2d084df Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-12-30 20:43:44 +01:00
dependabot[bot]
242fb9a356 Bump @aws-sdk/client-ecr-public from 3.43.0 to 3.45.0
Bumps [@aws-sdk/client-ecr-public](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecr-public) from 3.43.0 to 3.45.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.45.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>
2021-12-30 19:41:46 +00:00
CrazyMax
fa72313bc3 Merge pull request #132 from docker/dependabot/npm_and_yarn/aws-sdk/client-ecr-3.45.0
Bump @aws-sdk/client-ecr from 3.44.0 to 3.45.0
2021-12-30 20:39:56 +01:00
CrazyMax
088f62a4f2 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-12-30 19:35:40 +01:00
dependabot[bot]
7929ac7647 Bump @aws-sdk/client-ecr from 3.44.0 to 3.45.0
Bumps [@aws-sdk/client-ecr](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecr) from 3.44.0 to 3.45.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.45.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>
2021-12-24 05:13:23 +00:00
CrazyMax
9376d24995 Test login against ACR
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-12-22 11:30:57 +01:00
26 changed files with 15417 additions and 34395 deletions

23
.eslintrc.json Normal file
View File

@@ -0,0 +1,23 @@
{
"env": {
"node": true,
"es2021": true,
"jest": 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"
]
}

View File

@@ -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: ./
@@ -76,6 +76,20 @@ jobs:
docker image prune -a -f >/dev/null 2>&1
docker pull ghcr.io/docker-ghactiontest/test
acr:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to ACR
uses: ./
with:
registry: ${{ secrets.AZURE_REGISTRY_NAME }}.azurecr.io
username: ${{ secrets.AZURE_CLIENT_ID }}
password: ${{ secrets.AZURE_CLIENT_SECRET }}
dockerhub:
runs-on: ${{ matrix.os }}
strategy:
@@ -87,7 +101,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: ./
@@ -106,7 +120,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Login to ECR
uses: ./
@@ -126,10 +140,10 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
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 }}
@@ -151,7 +165,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Login to Public ECR
uses: ./
@@ -173,10 +187,10 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
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 }}
@@ -198,7 +212,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Login to GitHub Container Registry
uses: ./
@@ -218,7 +232,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Login to GitLab
uses: ./
@@ -238,7 +252,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Login to Google Artifact Registry
uses: ./
@@ -258,7 +272,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Login to Google Container Registry
uses: ./

View File

@@ -6,9 +6,6 @@ on:
- 'master'
- 'releases/v*'
pull_request:
branches:
- 'master'
- 'releases/v*'
jobs:
test:
@@ -16,19 +13,14 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Validate
uses: docker/bake-action@v1
with:
targets: validate
uses: actions/checkout@v3
-
name: Test
uses: docker/bake-action@v1
uses: docker/bake-action@v3
with:
targets: test
-
name: Upload coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
file: ./coverage/clover.xml

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

134
README.md
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
@@ -39,7 +39,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -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 }}
@@ -64,7 +64,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -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 }}
@@ -92,7 +92,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -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)
@@ -118,7 +120,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -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 }}
@@ -142,6 +144,45 @@ jobs:
> Google Container Registry, use the information [on this page](https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr)
> to learn about transitioning to Google Artifact Registry.
You can use either workload identity federation based keyless authentication or service account based authentication.
#### Workload identity federation based authentication
Configure the workload identity federation for github actions in gcloud (for steps, [refer here](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation)). In the steps, your service account should the ability to push to GCR. Then use google-github-actions/auth action for authentication using workload identity like below:
```yaml
name: ci
on:
push:
branches: main
jobs:
login:
runs-on: ubuntu-latest
steps:
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v0'
with:
token_format: 'access_token'
workload_identity_provider: '<workload_identity_provider>'
service_account: '<service_account>'
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: gcr.io
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
```
> Replace `<workload_identity_provider>` with configured workload identity provider. For steps to configure, [refer here](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation).
> Replace `<service_account>` with configured service account in workload identity provider which has access to push to GCR
#### Service account based authentication
Use a service account with the ability to push to GCR and [configure access control](https://cloud.google.com/container-registry/docs/access-control).
Then create and download the JSON key for this service account and save content of `.json` file
[as a secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)
@@ -153,7 +194,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -161,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
@@ -170,6 +211,47 @@ jobs:
### Google Artifact Registry (GAR)
You can use either workload identity federation based keyless authentication or service account based authentication.
#### Workload identity federation based authentication
Configure the workload identity federation for github actions in gcloud (for steps, [refer here](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation)). In the steps, your service account should the ability to push to GAR. Then use google-github-actions/auth action for authentication using workload identity like below:
```yaml
name: ci
on:
push:
branches: main
jobs:
login:
runs-on: ubuntu-latest
steps:
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v0'
with:
token_format: 'access_token'
workload_identity_provider: '<workload_identity_provider>'
service_account: '<service_account>'
- name: Login to GAR
uses: docker/login-action@v2
with:
registry: <location>-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
```
> Replace `<workload_identity_provider>` with configured workload identity provider
> Replace `<service_account>` with configured service account in workload identity provider which has access to push to GCR
> Replace `<location>` with the regional or multi-regional [location](https://cloud.google.com/artifact-registry/docs/repo-organize#locations)
> of the repository where the image is stored.
#### Service account based authentication
Use a service account with the ability to push to GAR and [configure access control](https://cloud.google.com/artifact-registry/docs/access-control).
Then create and download the JSON key for this service account and save content of `.json` file
[as a secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)
@@ -181,7 +263,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -189,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
@@ -210,7 +292,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -218,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 }}
@@ -233,7 +315,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -241,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 }}
@@ -260,7 +342,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -275,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
```
@@ -293,7 +375,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -301,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 }}
@@ -327,7 +409,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -335,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 }}
@@ -353,7 +435,7 @@ name: ci
on:
push:
branches: master
branches: main
jobs:
login:
@@ -361,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

@@ -1,3 +1,4 @@
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
import {AuthorizationData} from '@aws-sdk/client-ecr';
import * as aws from '../src/aws';

View File

@@ -1,3 +1,4 @@
import {expect, test} from '@jest/globals';
import {getInputs} from '../src/context';
test('with password and username getInputs does not throw error', async () => {
@@ -6,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,24 +1,24 @@
import {expect, jest, test} from '@jest/globals';
import {loginStandard, logout} from '../src/docker';
import * as path from 'path';
import * as exec from '@actions/exec';
process.env['RUNNER_TEMP'] = path.join(__dirname, 'runner');
test('loginStandard calls exec', async () => {
const execSpy: jest.SpyInstance = jest.spyOn(exec, 'getExecOutput');
execSpy.mockImplementation(() =>
Promise.resolve({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const execSpy = jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
return {
exitCode: expect.any(Number),
stdout: expect.any(Function),
stderr: expect.any(Function)
})
);
};
});
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);
@@ -30,16 +30,17 @@ test('loginStandard calls exec', async () => {
});
test('logout calls exec', async () => {
const execSpy: jest.SpyInstance = jest.spyOn(exec, 'getExecOutput');
execSpy.mockImplementation(() =>
Promise.resolve({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const execSpy = jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
return {
exitCode: expect.any(Number),
stdout: expect.any(Function),
stderr: expect.any(Function)
})
);
};
});
const registry: string = 'https://ghcr.io';
const registry = 'https://ghcr.io';
await logout(registry);

View File

@@ -1,46 +1,35 @@
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 () => {
const platSpy = jest.spyOn(osm, 'platform');
platSpy.mockImplementation(() => 'linux');
jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
process.env['INPUT_LOGOUT'] = 'true'; // default value
const coreSpy: jest.SpyInstance = 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 () => {
const platSpy = jest.spyOn(osm, 'platform');
platSpy.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(() => Promise.resolve());
const setRegistrySpy: jest.SpyInstance = jest.spyOn(stateHelper, 'setRegistry');
const setLogoutSpy: jest.SpyInstance = jest.spyOn(stateHelper, 'setLogout');
const dockerSpy: jest.SpyInstance = jest.spyOn(docker, 'login');
dockerSpy.mockImplementation(() => {});
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();
await main();
expect(setRegistrySpy).toHaveBeenCalledWith('');
expect(setLogoutSpy).toHaveBeenCalledWith(logout);
@@ -48,30 +37,27 @@ test('successful with username and password', async () => {
});
test('calls docker login', async () => {
const platSpy = jest.spyOn(osm, 'platform');
platSpy.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(() => Promise.resolve());
const setRegistrySpy: jest.SpyInstance = jest.spyOn(stateHelper, 'setRegistry');
const setLogoutSpy: jest.SpyInstance = jest.spyOn(stateHelper, 'setLogout');
const dockerSpy: jest.SpyInstance = jest.spyOn(docker, 'login');
dockerSpy.mockImplementation(() => {});
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();
await main();
expect(setRegistrySpy).toHaveBeenCalledWith(registry);
expect(setLogoutSpy).toHaveBeenCalledWith(logout);

View File

@@ -26,6 +26,6 @@ inputs:
required: false
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
post: 'dist/index.js'

View File

@@ -1,8 +1,8 @@
# syntax=docker/dockerfile:1.3-labs
# syntax=docker/dockerfile:1
ARG NODE_VERSION
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

31455
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

File diff suppressed because one or more lines are too long

12128
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

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,3 @@
variable "NODE_VERSION" {
default = "12"
}
target "node-version" {
args = {
NODE_VERSION = NODE_VERSION
}
}
group "default" {
targets = ["build"]
}
@@ -17,54 +7,47 @@ group "pre-checkin" {
}
group "validate" {
targets = ["format-validate", "build-validate", "vendor-validate"]
targets = ["lint", "build-validate", "vendor-validate"]
}
target "build" {
inherits = ["node-version"]
dockerfile = "./hack/build.Dockerfile"
dockerfile = "dev.Dockerfile"
target = "build-update"
output = ["."]
}
target "build-validate" {
inherits = ["node-version"]
dockerfile = "./hack/build.Dockerfile"
dockerfile = "dev.Dockerfile"
target = "build-validate"
output = ["type=cacheonly"]
}
target "format" {
inherits = ["node-version"]
dockerfile = "./hack/build.Dockerfile"
dockerfile = "dev.Dockerfile"
target = "format-update"
output = ["."]
}
target "format-validate" {
inherits = ["node-version"]
dockerfile = "./hack/build.Dockerfile"
target = "format-validate"
target "lint" {
dockerfile = "dev.Dockerfile"
target = "lint"
output = ["type=cacheonly"]
}
target "vendor-update" {
inherits = ["node-version"]
dockerfile = "./hack/build.Dockerfile"
dockerfile = "dev.Dockerfile"
target = "vendor-update"
output = ["."]
}
target "vendor-validate" {
inherits = ["node-version"]
dockerfile = "./hack/build.Dockerfile"
dockerfile = "dev.Dockerfile"
target = "vendor-validate"
output = ["type=cacheonly"]
}
target "test" {
inherits = ["node-version"]
dockerfile = "./hack/build.Dockerfile"
dockerfile = "dev.Dockerfile"
target = "test-coverage"
output = ["./coverage"]
}

View File

@@ -1,12 +0,0 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
setupFiles: ["dotenv/config"],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest'
},
verbose: false
}

29
jest.config.ts Normal file
View File

@@ -0,0 +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'],
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

@@ -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",
@@ -27,23 +27,26 @@
],
"license": "MIT",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/exec": "^1.1.0",
"@actions/io": "^1.1.1",
"@aws-sdk/client-ecr": "^3.44.0",
"@aws-sdk/client-ecr-public": "^3.43.0"
"@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/jest": "^26.0.23",
"@types/node": "^14.17.4",
"@vercel/ncc": "^0.28.6",
"dotenv": "^8.6.0",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
"jest-runtime": "^26.6.3",
"prettier": "^2.3.2",
"ts-jest": "^26.5.6",
"typescript": "^3.9.10",
"typescript-formatter": "^7.2.2"
"@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

@@ -1,6 +1,9 @@
import * as core from '@actions/core';
import {ECR} from '@aws-sdk/client-ecr';
import {ECRPUBLIC} from '@aws-sdk/client-ecr-public';
import {NodeHttpHandler} from '@aws-sdk/node-http-handler';
import {HttpProxyAgent} from 'http-proxy-agent';
import {HttpsProxyAgent} from 'https-proxy-agent';
const ecrRegistryRegex = /^(([0-9]{12})\.dkr\.ecr\.(.+)\.amazonaws\.com(.cn)?)(\/([^:]+)(:.+)?)?$/;
@@ -31,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(','));
}
@@ -54,6 +57,20 @@ export const getRegistriesData = async (registry: string, username?: string, pas
authTokenRequest['registryIds'] = accountIDs;
}
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;
const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY || '';
if (httpsProxy) {
core.debug(`Using https proxy ${httpsProxy}`);
httpsProxyAgent = new HttpsProxyAgent(httpsProxy);
}
const credentials =
username && password
? {
@@ -67,7 +84,11 @@ export const getRegistriesData = async (registry: string, username?: string, pas
const ecrPublic = new ECRPUBLIC({
customUserAgent: 'docker-login-action',
credentials,
region: region
region: region,
requestHandler: new NodeHttpHandler({
httpAgent: httpProxyAgent,
httpsAgent: httpsProxyAgent
})
});
const authTokenResponse = await ecrPublic.getAuthorizationToken(authTokenRequest);
if (!authTokenResponse.authorizationData || !authTokenResponse.authorizationData.authorizationToken) {
@@ -75,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',
@@ -87,7 +110,11 @@ export const getRegistriesData = async (registry: string, username?: string, pas
const ecr = new ECR({
customUserAgent: 'docker-login-action',
credentials,
region: region
region: region,
requestHandler: new NodeHttpHandler({
httpAgent: httpProxyAgent,
httpsAgent: httpsProxyAgent
})
});
const authTokenResponse = await ecr.getAuthorizationToken(authTokenRequest);
if (!Array.isArray(authTokenResponse.authorizationData) || !authTokenResponse.authorizationData.length) {
@@ -97,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> {
@@ -27,7 +25,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);
@@ -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,18 +1,21 @@
{
"compilerOptions": {
"esModuleInterop": true,
"target": "es6",
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"strict": true,
"newLine": "lf",
"outDir": "./lib",
"rootDir": "./src",
"strict": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": false,
"esModuleInterop": true,
"sourceMap": true
"resolveJsonModule": true,
"useUnknownInCatchVariables": false,
},
"exclude": ["node_modules", "**/*.test.ts"]
"exclude": [
"./__tests__/**/*",
"./lib/**/*",
"node_modules",
"jest.config.ts"
]
}

5588
yarn.lock

File diff suppressed because it is too large Load Diff