Compare commits

...

108 Commits

Author SHA1 Message Date
CrazyMax
1a162644f9
Merge pull request #1172 from crazy-max/build-export-disable
opt to disable build record upload
2024-07-02 18:38:46 +02:00
CrazyMax
9eea548195
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 18:19:48 +02:00
CrazyMax
11c2faaa9e
rename DOCKER_BUILD_EXPORT_RETENTION_DAYS to DOCKER_BUILD_RECORD_RETENTION_DAYS
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 18:13:41 +02:00
CrazyMax
de2365af33
opt to disable build record upload
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 18:07:54 +02:00
CrazyMax
bca5082da7
Merge pull request #1173 from crazy-max/build-summary-env-change
switch DOCKER_BUILD_SUMMARY_DISABLE to DOCKER_BUILD_SUMMARY
2024-07-02 17:59:43 +02:00
CrazyMax
e7aab408d9
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 17:55:45 +02:00
CrazyMax
63eb7590c6
switch DOCKER_BUILD_SUMMARY_DISABLE to DOCKER_BUILD_SUMMARY
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 17:55:44 +02:00
CrazyMax
53ec48606f
Merge pull request #1171 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.31.0
chore(deps): Bump @docker/actions-toolkit from 0.30.0 to 0.31.0
2024-07-02 15:28:50 +02:00
CrazyMax
fe9d9f1d0c
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 15:26:29 +02:00
dependabot[bot]
ad37ba1ad0
chore(deps): Bump @docker/actions-toolkit from 0.30.0 to 0.31.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.30.0 to 0.31.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.30.0...v0.31.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>
2024-07-02 13:25:11 +00:00
CrazyMax
aabbd3f4d7
Merge pull request #1170 from crazy-max/rename-summary-disable
rename DOCKER_BUILD_NO_SUMMARY to DOCKER_BUILD_SUMMARY_DISABLE
2024-07-02 15:11:52 +02:00
CrazyMax
9c7c277413
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 14:50:21 +02:00
CrazyMax
987902144c
rename DOCKER_BUILD_NO_SUMMARY to DOCKER_BUILD_SUMMARY_DISABLE
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 14:49:31 +02:00
CrazyMax
709dde20a7
Merge pull request #1160 from crazy-max/check-summary-support
move summary support check right after build
2024-07-02 14:28:05 +02:00
CrazyMax
ec2d640ea6
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 14:22:01 +02:00
CrazyMax
3dc0757c66
move summary support check right after build
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 14:20:56 +02:00
CrazyMax
dcb0699155
Merge pull request #1169 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.30.0
chore(deps): Bump @docker/actions-toolkit from 0.29.0 to 0.30.0
2024-07-02 14:16:55 +02:00
CrazyMax
a3c06e8698
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-02 14:14:03 +02:00
dependabot[bot]
e75138d857
chore(deps): Bump @docker/actions-toolkit from 0.29.0 to 0.30.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.29.0 to 0.30.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.29.0...v0.30.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>
2024-07-02 12:03:13 +00:00
CrazyMax
9552610e81
Merge pull request #1166 from crazy-max/subdir-supported
docs: subdir for git context supported since Docker 23
2024-07-01 13:43:50 +02:00
CrazyMax
99c83871c1
docs: subdir for git context supported since Docker 23
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-01 00:54:10 +02:00
CrazyMax
af64c4e18f
Merge pull request #1161 from docker/readme-summaries
readme: add section on job summaries
2024-06-27 14:15:15 +02:00
David Karlsson
6fdff4fb09 readme: add section on job summaries
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-06-27 13:51:35 +02:00
CrazyMax
9e59c61762
Merge pull request #1159 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.29.0
chore(deps): Bump @docker/actions-toolkit from 0.28.0 to 0.29.0
2024-06-27 11:11:05 +02:00
CrazyMax
49351df2b7
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-27 11:08:00 +02:00
dependabot[bot]
723ff6ffad
chore(deps): Bump @docker/actions-toolkit from 0.28.0 to 0.29.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.28.0 to 0.29.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.28.0...v0.29.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>
2024-06-27 09:03:36 +00:00
CrazyMax
15560696de
Merge pull request #1158 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.28.0
chore(deps): Bump @docker/actions-toolkit from 0.27.0 to 0.28.0
2024-06-26 14:20:37 +02:00
CrazyMax
57e1d34ac3
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-26 14:14:54 +02:00
dependabot[bot]
309982ebc9
chore(deps): Bump @docker/actions-toolkit from 0.27.0 to 0.28.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.27.0 to 0.28.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.27.0...v0.28.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>
2024-06-26 12:10:23 +00:00
CrazyMax
9476c25b2a
Merge pull request #1153 from crazy-max/export-retention
use default retention days for build export artifact
2024-06-26 14:00:48 +02:00
CrazyMax
97be5a4928
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-24 10:28:21 +02:00
CrazyMax
9cac6c8ea0
use default retention days for build export artifact
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-24 10:28:21 +02:00
CrazyMax
31159d49c0
Merge pull request #1149 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.27.0
chore(deps): Bump @docker/actions-toolkit from 0.26.2 to 0.27.0
2024-06-20 19:22:45 +02:00
CrazyMax
07e1c3e148
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-20 19:18:43 +02:00
dependabot[bot]
f7febd621d
chore(deps): Bump @docker/actions-toolkit from 0.26.2 to 0.27.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.26.2 to 0.27.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.26.2...v0.27.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>
2024-06-20 17:13:56 +00:00
CrazyMax
f6010ea701
Merge pull request #1147 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.26.2
chore(deps): Bump @docker/actions-toolkit from 0.26.1 to 0.26.2
2024-06-20 15:56:23 +02:00
CrazyMax
c0a6b9680f
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-20 14:56:13 +02:00
dependabot[bot]
0dfe9c3d41
chore(deps): Bump @docker/actions-toolkit from 0.26.1 to 0.26.2
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.26.1 to 0.26.2.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.26.1...v0.26.2)

---
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>
2024-06-20 11:15:38 +00:00
CrazyMax
94f8f8c2ee
Merge pull request #1142 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.26.1
chore(deps): Bump @docker/actions-toolkit from 0.26.0 to 0.26.1
2024-06-18 17:39:29 +02:00
CrazyMax
22f4433c58
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-18 17:37:35 +02:00
dependabot[bot]
6721c56015
chore(deps): Bump @docker/actions-toolkit from 0.26.0 to 0.26.1
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.26.0 to 0.26.1.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.26.0...v0.26.1)

---
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>
2024-06-18 15:33:20 +00:00
CrazyMax
4367da978b
Merge pull request #1140 from docker/dependabot/github_actions/docker/bake-action-5
chore(deps): Bump docker/bake-action from 4 to 5
2024-06-17 13:17:16 +02:00
CrazyMax
0883ebe52d
Merge pull request #1139 from crazy-max/bump-major
docs: bump actions to latest major
2024-06-17 13:16:55 +02:00
dependabot[bot]
76e5c2d6ea
chore(deps): Bump docker/bake-action from 4 to 5
Bumps [docker/bake-action](https://github.com/docker/bake-action) from 4 to 5.
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](https://github.com/docker/bake-action/compare/v4...v5)

---
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>
2024-06-17 11:08:17 +00:00
CrazyMax
29d67824d8
docs: bump actions to latest major
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-17 11:46:56 +02:00
CrazyMax
c382f710d3
Merge pull request #1120 from crazy-max/build-summary
export build record and generate summary
2024-06-17 09:23:45 +02:00
CrazyMax
5a5b70d974
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-14 16:11:49 +02:00
CrazyMax
dc24cf9e25
don't generate summary for cloud driver
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-14 16:06:09 +02:00
CrazyMax
667cb22c52
DOCKER_BUILD_NO_SUMMARY env to disable summary
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-14 16:06:09 +02:00
CrazyMax
d880b1964b
generate build summary
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-14 16:06:08 +02:00
CrazyMax
e51051ad0b
export build record and upload artifact
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-14 16:06:08 +02:00
CrazyMax
86c2bd0031
Merge pull request #1137 from docker/dependabot/npm_and_yarn/braces-3.0.3
chore(deps): Bump braces from 3.0.2 to 3.0.3
2024-06-14 16:05:47 +02:00
CrazyMax
268d2b1611
Merge pull request #1138 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.26.0
chore(deps): Bump @docker/actions-toolkit from 0.25.1 to 0.26.0
2024-06-14 16:02:14 +02:00
CrazyMax
2b8dc7f529
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-14 15:59:52 +02:00
dependabot[bot]
840c12be17
chore(deps): Bump @docker/actions-toolkit from 0.25.1 to 0.26.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.25.1 to 0.26.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.25.1...v0.26.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>
2024-06-14 13:55:22 +00:00
dependabot[bot]
26368743c0
chore(deps): Bump braces from 3.0.2 to 3.0.3
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-12 07:44:48 +00:00
CrazyMax
cfed4e995e
Merge pull request #1136 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.25.1
chore(deps): Bump @docker/actions-toolkit from 0.25.0 to 0.25.1
2024-06-12 09:42:53 +02:00
CrazyMax
dca03ca8fd
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-12 09:38:12 +02:00
dependabot[bot]
e030091ff4
chore(deps): Bump @docker/actions-toolkit from 0.25.0 to 0.25.1
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.25.0 to 0.25.1.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.25.0...v0.25.1)

---
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>
2024-06-12 07:34:37 +00:00
CrazyMax
84354d3b32
Merge pull request #1132 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.25.0
chore(deps): Bump @docker/actions-toolkit from 0.24.0 to 0.25.0
2024-06-10 15:14:08 +02:00
CrazyMax
de5408fe94
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-10 15:12:15 +02:00
CrazyMax
cfc1555281
fix tests after changes with provenance builder-id
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-06-10 15:06:45 +02:00
dependabot[bot]
f6a172d30e
chore(deps): Bump @docker/actions-toolkit from 0.24.0 to 0.25.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.24.0 to 0.25.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.24.0...v0.25.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>
2024-06-10 12:56:13 +00:00
CrazyMax
ca052bb54a
Merge pull request #1128 from crazy-max/builder-info
show builder information before building
2024-05-29 14:20:19 +02:00
CrazyMax
025c2051f3
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-29 12:53:55 +02:00
CrazyMax
12076d2fb1
show builder information before building
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-29 12:52:50 +02:00
CrazyMax
ef6cba3353
Merge pull request #1127 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.24.0
chore(deps): Bump @docker/actions-toolkit from 0.23.0 to 0.24.0
2024-05-27 12:51:04 +02:00
CrazyMax
4c16cf906a
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-27 12:48:55 +02:00
CrazyMax
a3118a86c8
fixes since moved types
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-27 12:45:25 +02:00
dependabot[bot]
c86eb8b0f7
chore(deps): Bump @docker/actions-toolkit from 0.23.0 to 0.24.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.23.0 to 0.24.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.23.0...v0.24.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>
2024-05-27 10:44:02 +00:00
CrazyMax
2a53c6ccda
Merge pull request #1122 from crazy-max/update-dev-deps
chore: update dev dependencies
2024-05-15 13:47:05 +02:00
CrazyMax
ccef1f210d
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-15 13:44:48 +02:00
CrazyMax
79117b6ea5
chore: update dev dependencies
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-15 13:41:47 +02:00
CrazyMax
df19a799eb
Merge pull request #1121 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.23.0
chore(deps): Bump @docker/actions-toolkit from 0.22.0 to 0.23.0
2024-05-14 14:34:37 +02:00
CrazyMax
0e2ab16cd2
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-14 14:32:09 +02:00
CrazyMax
54d0f58d64
fixes related to actions-toolkit 0.23.0 changes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-14 14:11:32 +02:00
dependabot[bot]
563a2f55e4
chore(deps): Bump @docker/actions-toolkit from 0.22.0 to 0.23.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.22.0 to 0.23.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.22.0...v0.23.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>
2024-05-14 11:51:36 +00:00
CrazyMax
6003d3266a
Merge pull request #1115 from crazy-max/fix-e2e-artifactory
ci(e2e): fix artifactory slug
2024-05-10 10:21:37 +02:00
CrazyMax
e1e22cdde8
ci(e2e): fix artifactory slug
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-10 10:19:21 +02:00
CrazyMax
fc15b64049
Merge pull request #1114 from crazy-max/e2e-artifactory
ci(e2e): update artifactory instance
2024-05-10 10:15:01 +02:00
CrazyMax
6c58ea3670
ci(e2e): update artifactory instance
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-10 09:56:42 +02:00
CrazyMax
729f7f4926
Merge pull request #1109 from crazy-max/align-inputs-iface
align interface fields with action inputs
2024-05-06 12:18:15 +02:00
CrazyMax
99d83235bc
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-06 12:11:32 +02:00
CrazyMax
1d5307d7af
align interface fields with action inputs
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-06 12:08:12 +02:00
CrazyMax
cf8d130912
Merge pull request #1110 from crazy-max/update-yarn
update to yarn 3.6.3
2024-05-06 12:07:31 +02:00
CrazyMax
8804d8e2ac
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-06 12:02:50 +02:00
CrazyMax
1984549052
chore: add plugin-interactive-tools yarn pkg
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-06 12:01:44 +02:00
CrazyMax
5bc9e2e9b9
update to yarn 3.6.3
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-06 12:01:20 +02:00
CrazyMax
eb539f44b1
Merge pull request #1090 from docker/dependabot/npm_and_yarn/undici-5.28.4
chore(deps): Bump undici from 5.28.3 to 5.28.4
2024-04-26 13:42:42 +02:00
CrazyMax
b6ff9e5753
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-26 13:06:55 +02:00
dependabot[bot]
929fba6cce
chore(deps): Bump undici from 5.28.3 to 5.28.4
Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.3...v5.28.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-26 10:59:25 +00:00
CrazyMax
7f1f43ba33
Merge pull request #1105 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.22.0
chore(deps): Bump @docker/actions-toolkit from 0.20.0 to 0.22.0
2024-04-26 12:22:27 +02:00
CrazyMax
40d6a900e0
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-26 11:54:16 +02:00
CrazyMax
d56be63626
Merge pull request #1106 from crazy-max/docs-rm-stubs
docs: remove stub files
2024-04-26 11:21:16 +02:00
CrazyMax
eb3cfeaf00
switch to new Build class
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-26 11:20:49 +02:00
CrazyMax
d0fc12d8a4
docs: remove stub files
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-26 11:12:45 +02:00
dependabot[bot]
68615d5b67
chore(deps): Bump @docker/actions-toolkit from 0.20.0 to 0.22.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.20.0 to 0.22.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.20.0...v0.22.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>
2024-04-26 09:09:12 +00:00
CrazyMax
c3b570184c
Merge pull request #1086 from crazy-max/fix-attests-provenance-sbom
handle attests correctly with provenance and sbom inputs
2024-04-26 11:05:55 +02:00
CrazyMax
7e6f77677b
Merge pull request #1095 from crazy-max/ci-use-stable-1
ci: switch to stable buildkit image for load and push
2024-04-16 08:47:52 +02:00
CrazyMax
2ce6beaad4
readme: update following latest buildx/buildkit releases
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-15 09:50:33 +02:00
CrazyMax
4c8d1e6826
ci: switch to stable buildkit image for load and push
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-15 09:47:50 +02:00
CrazyMax
b0312962ef
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-02 10:58:32 +02:00
CrazyMax
96acf63e4c
handle attests correctly with provenance and sbom inputs
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-02 10:54:20 +02:00
CrazyMax
f8bc7f4600
Merge pull request #1088 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.20.0
chore(deps): Bump @docker/actions-toolkit from 0.19.0 to 0.20.0
2024-04-02 10:47:32 +02:00
CrazyMax
c2064be02c
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-02 10:43:15 +02:00
dependabot[bot]
4f02f34098
chore(deps): Bump @docker/actions-toolkit from 0.19.0 to 0.20.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.19.0 to 0.20.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.19.0...v0.20.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>
2024-04-02 08:41:33 +00:00
CrazyMax
090ca155fc
Merge pull request #1081 from crazy-max/ci-update-bk-config
ci: use buildkitd-config input
2024-03-18 09:33:18 +01:00
CrazyMax
ec4854f780
ci: use buildkitd-config input
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-03-17 18:33:27 +01:00
39 changed files with 10184 additions and 4504 deletions

View File

@ -1,2 +1,12 @@
/coverage
/node_modules
# Dependency directories
node_modules/
jspm_packages/
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

View File

@ -13,7 +13,7 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"ecmaVersion": 2023,
"sourceType": "module"
},
"plugins": [

2
.gitattributes vendored
View File

@ -1,2 +1,4 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
/dist/** linguist-generated=true
/lib/** linguist-generated=true

BIN
.github/build-push-summary.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -94,7 +94,7 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
version: ${{ matrix.buildx_version }}
config: /tmp/buildkitd.toml
buildkitd-config: /tmp/buildkitd.toml
buildkitd-flags: --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
driver-opts: |
image=${{ matrix.buildkit_image }}

View File

@ -1274,10 +1274,9 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
# TODO: use buildx-stable-1 image when v0.13 promoted
driver-opts: |
network=host
image=moby/buildkit:v0.13.0
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build
@ -1324,10 +1323,9 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
# TODO: use buildx-stable-1 image when v0.13 promoted
driver-opts: |
network=host
image=moby/buildkit:v0.13.0
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build
@ -1346,3 +1344,122 @@ jobs:
name: Check docker
run: |
docker image inspect localhost:5000/name/app:latest
summary-disable:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: action
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
driver-opts: |
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
-
name: Build
uses: ./action
with:
file: ./test/Dockerfile
env:
DOCKER_BUILD_SUMMARY: false
summary-disable-deprecated:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: action
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
driver-opts: |
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
-
name: Build
uses: ./action
with:
file: ./test/Dockerfile
env:
DOCKER_BUILD_NO_SUMMARY: true
summary-not-supported:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: action
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.12.1
driver-opts: |
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
-
name: Build
uses: ./action
with:
file: ./test/Dockerfile
record-upload-disable:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: action
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
driver-opts: |
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
-
name: Build
uses: ./action
with:
file: ./test/Dockerfile
env:
DOCKER_BUILD_RECORD_UPLOAD: false
record-retention-days:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
days:
- 2
- 0
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
path: action
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
driver-opts: |
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
-
name: Build
uses: ./action
with:
file: ./test/Dockerfile
env:
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ matrix.days }}

View File

@ -88,13 +88,13 @@ jobs:
username_secret: QUAY_USERNAME
password_secret: QUAY_TOKEN
type: remote
# -
# name: Artifactory
# registry: sforzando-build-team-local.jfrog.io
# slug: sforzando-build-team-local.jfrog.io/build-push-action-e2e
# username_secret: ARTIFACTORY_USERNAME
# password_secret: ARTIFACTORY_TOKEN
# type: remote
-
name: Artifactory
registry: infradock.jfrog.io
slug: infradock.jfrog.io/test-ghaction/build-push-action
username_secret: ARTIFACTORY_USERNAME
password_secret: ARTIFACTORY_TOKEN
type: remote
-
name: Harbor
id: harbor

View File

@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v4
-
name: Test
uses: docker/bake-action@v4
uses: docker/bake-action@v5
with:
targets: test
-

View File

@ -40,6 +40,6 @@ jobs:
uses: actions/checkout@v4
-
name: Validate
uses: docker/bake-action@v4
uses: docker/bake-action@v5
with:
targets: ${{ matrix.target }}

66
.gitignore vendored
View File

@ -1,7 +1,5 @@
node_modules
lib
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
@ -9,6 +7,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@ -19,34 +18,14 @@ pids
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
@ -56,36 +35,19 @@ typings/
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

6
.prettierignore Normal file
View File

@ -0,0 +1,6 @@
# Dependency directories
node_modules/
jspm_packages/
# yarn v2
.yarn/

File diff suppressed because one or more lines are too long

13
.yarnrc.yml Normal file
View File

@ -0,0 +1,13 @@
logFilters:
- code: YN0013
level: discard
- code: YN0019
level: discard
- code: YN0076
level: discard
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

View File

@ -19,21 +19,11 @@ ___
* [Git context](#git-context)
* [Path context](#path-context)
* [Examples](#examples)
* [Multi-platform image](https://docs.docker.com/build/ci/github-actions/multi-platform/)
* [Secrets](https://docs.docker.com/build/ci/github-actions/secrets/)
* [Push to multi-registries](https://docs.docker.com/build/ci/github-actions/push-multi-registries/)
* [Manage tags and labels](https://docs.docker.com/build/ci/github-actions/manage-tags-labels/)
* [Cache management](https://docs.docker.com/build/ci/github-actions/cache/)
* [Export to Docker](https://docs.docker.com/build/ci/github-actions/export-docker/)
* [Test before push](https://docs.docker.com/build/ci/github-actions/test-before-push/)
* [Local registry](https://docs.docker.com/build/ci/github-actions/local-registry/)
* [Share built image between jobs](https://docs.docker.com/build/ci/github-actions/share-image-jobs/)
* [Named contexts](https://docs.docker.com/build/ci/github-actions/named-contexts/)
* [Copy image between registries](https://docs.docker.com/build/ci/github-actions/copy-image-registries/)
* [Update Docker Hub repo description](https://docs.docker.com/build/ci/github-actions/update-dockerhub-desc/)
* [Summaries](#summaries)
* [Customizing](#customizing)
* [inputs](#inputs)
* [outputs](#outputs)
* [environment variables](#environment-variables)
* [Troubleshooting](#troubleshooting)
* [Contributing](#contributing)
@ -65,8 +55,6 @@ name: ci
on:
push:
branches:
- 'main'
jobs:
docker:
@ -86,7 +74,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
tags: user/app:latest
@ -104,28 +92,15 @@ expression `{{defaultContext}}`. Here we can use it to provide a subdirectory
to the default Git context:
```yaml
-
# Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:mysubdir"
push: true
tags: user/app:latest
```
> **Warning**
>
> Subdirectory for Git context is available from [BuildKit v0.9.0](https://github.com/moby/buildkit/releases/tag/v0.9.0).
> If you're using the `docker` builder (default if `setup-buildx-action` not used),
> then BuildKit in Docker Engine will be used. As Docker Engine < v22.x.x embeds
> Buildkit 0.8.2 at the moment, it does not support this feature. It's therefore
> required to use the `setup-buildx-action` at the moment.
Building from the current repository automatically uses the [GitHub Token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication),
so it does not need to be passed. If you want to authenticate against another
private repository, you have to use a [secret](https://docs.docker.com/build/ci/github-actions/secrets)
@ -134,7 +109,7 @@ named `GIT_AUTH_TOKEN` to be able to authenticate against it with Buildx:
```yaml
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
tags: user/app:latest
@ -149,8 +124,6 @@ name: ci
on:
push:
branches:
- 'main'
jobs:
docker:
@ -173,7 +146,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
@ -194,12 +167,35 @@ jobs:
* [Named contexts](https://docs.docker.com/build/ci/github-actions/named-contexts/)
* [Copy image between registries](https://docs.docker.com/build/ci/github-actions/copy-image-registries/)
* [Update Docker Hub repo description](https://docs.docker.com/build/ci/github-actions/update-dockerhub-desc/)
* [SBOM and provenance attestations](https://docs.docker.com/build/ci/github-actions/attestations/)
* [Annotations](https://docs.docker.com/build/ci/github-actions/annotations/)
* [Reproducible builds](https://docs.docker.com/build/ci/github-actions/reproducible-builds/)
## Summaries
This action generates a [job summary](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/)
that provides a detailed overview of the build execution. The summary shows an
overview of all the steps executed during the build, including the build inputs
and eventual errors.
![build-push-action job summary](./.github/build-push-summary.png)
The summary also includes a link for downloading the build record with
additional details about the build, including build stats, logs, outputs, and
more. The build record can be imported to Docker Desktop for inspecting the
build in greater detail.
Summaries are enabled by default, but can be disabled with the
`DOCKER_BUILD_SUMMARY` [environment variable](#environment-variables).
For more information about summaries, refer to the
[documentation](https://docs.docker.com/go/build-summary/).
## Customizing
### inputs
Following inputs can be used as `step.with` keys
The following inputs can be used as `step.with` keys:
> `List` type is a newline-delimited string
> ```yaml
@ -232,7 +228,7 @@ Following inputs can be used as `step.with` keys
| `network` | String | Set the networking mode for the `RUN` instructions during build |
| `no-cache` | Bool | Do not use cache when building the image (default `false`) |
| `no-cache-filters` | List/CSV | Do not cache specified stages |
| `outputs`¹ | List | List of [output destinations](https://docs.docker.com/engine/reference/commandline/buildx_build/#output) (format: `type=local,dest=path`) |
| `outputs` | List | List of [output destinations](https://docs.docker.com/engine/reference/commandline/buildx_build/#output) (format: `type=local,dest=path`) |
| `platforms` | List/CSV | List of [target platforms](https://docs.docker.com/engine/reference/commandline/buildx_build/#platform) for build |
| `provenance` | Bool/String | Generate [provenance](https://docs.docker.com/build/attestations/slsa-provenance/) attestation for the build (shorthand for `--attest=type=provenance`) |
| `pull` | Bool | Always attempt to pull all referenced images (default `false`) |
@ -248,10 +244,6 @@ Following inputs can be used as `step.with` keys
| `ulimit` | List | [Ulimit](https://docs.docker.com/engine/reference/commandline/buildx_build/#ulimit) options (e.g., `nofile=1024:1024`) |
| `github-token` | String | GitHub Token used to authenticate against a repository for [Git context](#git-context) (default `${{ github.token }}`) |
> **Note**
>
> * ¹ multiple `outputs` are [not yet supported](https://github.com/moby/buildkit/issues/1555)
### outputs
The following outputs are available:
@ -262,6 +254,14 @@ The following outputs are available:
| `digest` | String | Image digest |
| `metadata` | JSON | Build result metadata |
### environment variables
| Name | Type | Default | Description |
|--------------------------------------|--------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `DOCKER_BUILD_SUMMARY` | Bool | `true` | If `false`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
| `DOCKER_BUILD_RECORD_UPLOAD` | Bool | `true` | If `false`, build record upload as [GitHub artifact](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts) is disabled |
| `DOCKER_BUILD_RECORD_RETENTION_DAYS` | Number | | Duration after which build record artifact will expire in days. Defaults to repository/org [retention settings](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy) if unset or `0` |
## Troubleshooting
See [TROUBLESHOOTING.md](TROUBLESHOOTING.md)

View File

@ -59,7 +59,7 @@ jobs:
uses: crazy-max/ghaction-setup-containerd@v2
-
name: Build Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
@ -112,7 +112,7 @@ to generate sanitized tags:
tags: latest
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
@ -130,7 +130,7 @@ Or a dedicated step to sanitize the slug:
script: return 'ghcr.io/${{ github.repository }}'.toLowerCase()
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true

View File

@ -1,13 +1,16 @@
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';
import {Builder} from '@docker/actions-toolkit/lib/buildx/builder';
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
import {Build} from '@docker/actions-toolkit/lib/buildx/build';
import {Context} from '@docker/actions-toolkit/lib/context';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {GitHub} from '@docker/actions-toolkit/lib/github';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
import {BuilderInfo} from '@docker/actions-toolkit/lib/types/builder';
import {BuilderInfo} from '@docker/actions-toolkit/lib/types/buildx/builder';
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github';
import * as context from '../src/context';
@ -35,6 +38,16 @@ jest.spyOn(Docker, 'isAvailable').mockImplementation(async (): Promise<boolean>
return true;
});
const metadataJson = path.join(tmpDir, 'metadata.json');
jest.spyOn(Build.prototype, 'getMetadataFilePath').mockImplementation((): string => {
return metadataJson;
});
const imageIDFilePath = path.join(tmpDir, 'iidfile.txt');
jest.spyOn(Build.prototype, 'getImageIDFilePath').mockImplementation((): string => {
return imageIDFilePath;
});
jest.spyOn(Builder.prototype, 'inspect').mockImplementation(async (): Promise<BuilderInfo> => {
return {
name: 'builder2',
@ -78,7 +91,7 @@ describe('getArgs', () => {
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'.'
]
],
@ -101,7 +114,7 @@ ccc"`],
'--build-arg', 'MY_ARG=val1,val2,val3',
'--build-arg', 'ARG=val',
'--build-arg', `MULTILINE=aaaa\nbbbb\nccc`,
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'https://github.com/docker/build-push-action.git#refs/heads/master'
]
],
@ -117,7 +130,7 @@ ccc"`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--tag', 'name/app:7.4',
'--tag', 'name/app:latest',
'https://github.com/docker/build-push-action.git#refs/heads/master'
@ -172,7 +185,7 @@ ccc"`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'.'
]
],
@ -189,7 +202,7 @@ ccc"`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'.'
]
@ -230,7 +243,7 @@ ccc"`],
[
'build',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--platform', 'linux/amd64,linux/arm64',
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'--builder', 'builder-git-context-2',
@ -264,7 +277,7 @@ ccc"`],
[
'build',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--platform', 'linux/amd64,linux/arm64',
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'--secret', `id=MYSECRET,src=${tmpName}`,
@ -301,7 +314,7 @@ ccc`],
[
'build',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--platform', 'linux/amd64,linux/arm64',
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'--secret', `id=MYSECRET,src=${tmpName}`,
@ -330,7 +343,7 @@ ccc`],
[
'build',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--secret', `id=MY_SECRET,src=${tmpName}`,
'--builder', 'builder-git-context-2',
'--network', 'host',
@ -377,8 +390,8 @@ ccc`],
'--add-host', 'docker:10.180.0.1',
'--add-host', 'foo:10.0.0.1',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--metadata-file', metadataJson,
'--network', 'host',
'--push',
'.'
@ -406,11 +419,11 @@ nproc=3`],
'--add-host', 'foo:10.0.0.1',
'--cgroup-parent', 'foo',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--shm-size', '2g',
'--ulimit', 'nofile=1024:1024',
'--ulimit', 'nproc=3',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -426,8 +439,8 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--metadata-file', metadataJson,
'https://github.com/docker/build-push-action.git#refs/heads/master:docker'
]
],
@ -444,9 +457,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir'
]
],
@ -463,8 +476,8 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--metadata-file', metadataJson,
'.'
]
],
@ -480,9 +493,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
"--provenance", `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--metadata-file', metadataJson,
'.'
]
],
@ -499,9 +512,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
"--provenance", `builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--metadata-file', metadataJson,
'.'
]
],
@ -518,9 +531,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
"--provenance", `mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--metadata-file', metadataJson,
'.'
]
],
@ -537,9 +550,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
"--provenance", 'false',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--attest', 'type=provenance,disabled=true',
'--metadata-file', metadataJson,
'.'
]
],
@ -556,9 +569,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
"--provenance", 'builder-id=foo',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--attest', 'type=provenance,builder-id=foo',
'--metadata-file', metadataJson,
'.'
]
],
@ -575,9 +588,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
"--output", 'type=docker',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -593,9 +606,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--load',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -613,14 +626,14 @@ nproc=3`],
[
'build',
'--build-arg', 'FOO=bar#baz',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--load',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
[
25,
26,
'0.10.0',
new Map<string, string>([
['context', '.'],
@ -635,14 +648,14 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
'build',
'--secret', 'id=MY_SECRET,env=MY_SECRET_ENV',
'--secret', 'id=ANOTHER_SECRET,env=ANOTHER_SECRET_ENV',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--load',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
[
26,
27,
'0.10.0',
new Map<string, string>([
['context', '.'],
@ -656,14 +669,14 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
'build',
'--secret', 'id=MY_SECRET,env=MY_SECRET_ENV',
'--secret', 'id=ANOTHER_SECRET,env=ANOTHER_SECRET_ENV',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--load',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
[
27,
28,
'0.11.0',
new Map<string, string>([
['context', '.'],
@ -677,13 +690,13 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
[
'build',
'--output', 'type=local,dest=./release-out',
"--provenance", `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--metadata-file', metadataJson,
'.'
]
],
[
28,
29,
'0.12.0',
new Map<string, string>([
['context', '.'],
@ -701,13 +714,13 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
'--annotation', 'manifest:example3=yyy',
'--annotation', 'manifest-descriptor[linux/amd64]:example4=zzz',
'--output', 'type=local,dest=./release-out',
"--provenance", `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--metadata-file', metadataJson,
'.'
]
],
[
29,
30,
'0.12.0',
new Map<string, string>([
['context', '.'],
@ -719,13 +732,73 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
"--output", `type=image,"name=localhost:5000/name/app:latest,localhost:5000/name/app:foo",push-by-digest=true,name-canonical=true,push=true`,
"--provenance", `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--metadata-file', metadataJson,
'.'
]
]
],
[
31,
'0.13.1',
new Map<string, string>([
['context', '.'],
['load', 'false'],
['no-cache', 'false'],
['push', 'false'],
['pull', 'false'],
['provenance', 'mode=max'],
['sbom', 'true'],
]),
[
'build',
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--attest', `type=sbom,disabled=false`,
'--metadata-file', metadataJson,
'.'
]
],
[
32,
'0.13.1',
new Map<string, string>([
['context', '.'],
['load', 'false'],
['no-cache', 'false'],
['push', 'false'],
['pull', 'false'],
['attests', 'type=provenance,mode=min'],
['provenance', 'mode=max'],
]),
[
'build',
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--metadata-file', metadataJson,
'.'
]
],
[
33,
'0.13.1',
new Map<string, string>([
['context', '.'],
['load', 'false'],
['no-cache', 'false'],
['push', 'false'],
['pull', 'false'],
['attests', 'type=provenance,mode=min'],
]),
[
'build',
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=min,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--metadata-file', metadataJson,
'.'
]
],
])(
'[%d] given %p with %p as inputs, returns %p',
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {

View File

@ -5,9 +5,16 @@ ARG NODE_VERSION=20
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
WORKDIR /src
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache <<EOT
corepack enable
yarn --version
yarn config set --home enableTelemetry 0
EOT
FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn install && mkdir /vendor && cp yarn.lock /vendor
@ -16,18 +23,19 @@ COPY --from=deps /vendor /
FROM deps AS vendor-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
git status --porcelain -- yarn.lock
exit 1
fi
set -e
git add -A
cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
git status --porcelain -- yarn.lock
exit 1
fi
EOT
FROM deps AS build
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run build && mkdir /out && cp -Rf dist /out/
@ -36,32 +44,35 @@ COPY --from=build /out /
FROM build AS build-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /out/* .
if [ -n "$(git status --porcelain -- dist)" ]; then
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
git status --porcelain -- dist
exit 1
fi
set -e
git add -A
cp -rf /out/* .
if [ -n "$(git status --porcelain -- dist)" ]; then
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
git status --porcelain -- dist
exit 1
fi
EOT
FROM deps AS format
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run format \
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
FROM scratch AS format-update
COPY --from=format /out /
FROM deps AS lint
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run lint
FROM deps AS test
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run test --coverage --coverageDirectory=/tmp/coverage

87
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

2071
dist/licenses.txt generated vendored

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ group "default" {
}
group "pre-checkin" {
targets = ["vendor-update", "format", "build"]
targets = ["vendor", "format", "build"]
}
group "validate" {
@ -34,7 +34,7 @@ target "lint" {
output = ["type=cacheonly"]
}
target "vendor-update" {
target "vendor" {
dockerfile = "dev.Dockerfile"
target = "vendor-update"
output = ["."]

View File

@ -1,3 +0,0 @@
# Cache
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/cache/)

View File

@ -1,3 +0,0 @@
# Copy images between registries
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/copy-image-registries/)

View File

@ -1,3 +0,0 @@
# Update Docker Hub repo description
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/update-dockerhub-desc/)

View File

@ -1,3 +0,0 @@
# Export image to Docker
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/export-docker/)

View File

@ -1,3 +0,0 @@
# Isolated builders
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#isolated-builders)

View File

@ -1,3 +0,0 @@
# Local registry
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/local-registry/)

View File

@ -1,3 +0,0 @@
# Multi-platform image
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/multi-platform/)

View File

@ -1,3 +0,0 @@
# Named contexts
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/named-contexts/)

View File

@ -1,3 +0,0 @@
# Push to multi-registries
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/push-multi-registries/)

View File

@ -1,3 +0,0 @@
# Secrets
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/secrets/)

View File

@ -1,3 +0,0 @@
# Share built image between jobs
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/share-image-jobs/)

View File

@ -1,3 +0,0 @@
# Handle tags and labels
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/manage-tags-labels/)

View File

@ -1,3 +0,0 @@
# Test your image before pushing it
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/test-before-push/)

View File

@ -1,17 +1,16 @@
{
"name": "docker-build-push",
"description": "Build and push Docker images",
"main": "lib/main.js",
"main": "src/main.ts",
"scripts": {
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
"build": "ncc build --source-map --minify --license licenses.txt",
"lint": "yarn run prettier && yarn run eslint",
"format": "yarn run prettier:fix && yarn run eslint:fix",
"eslint": "eslint --max-warnings=0 .",
"eslint:fix": "eslint --fix .",
"prettier": "prettier --check \"./**/*.ts\"",
"prettier:fix": "prettier --write \"./**/*.ts\"",
"test": "jest",
"all": "yarn run build && yarn run format && yarn test"
"test": "jest"
},
"repository": {
"type": "git",
@ -25,25 +24,25 @@
],
"author": "Docker Inc.",
"license": "Apache-2.0",
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.10.1",
"@docker/actions-toolkit": "0.19.0",
"@docker/actions-toolkit": "0.31.0",
"handlebars": "^4.7.7"
},
"devDependencies": {
"@types/csv-parse": "^1.2.2",
"@types/node": "^20.5.9",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@vercel/ncc": "^0.38.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.4",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
"@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.5.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
}
}

View File

@ -1,29 +1,30 @@
import * as core from '@actions/core';
import * as handlebars from 'handlebars';
import {Build} from '@docker/actions-toolkit/lib/buildx/build';
import {Context} from '@docker/actions-toolkit/lib/context';
import {GitHub} from '@docker/actions-toolkit/lib/github';
import {Inputs as BuildxInputs} from '@docker/actions-toolkit/lib/buildx/inputs';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
import {Util} from '@docker/actions-toolkit/lib/util';
export interface Inputs {
addHosts: string[];
'add-hosts': string[];
allow: string[];
annotations: string[];
attests: string[];
buildArgs: string[];
buildContexts: string[];
'build-args': string[];
'build-contexts': string[];
builder: string;
cacheFrom: string[];
cacheTo: string[];
cgroupParent: string;
'cache-from': string[];
'cache-to': string[];
'cgroup-parent': string;
context: string;
file: string;
labels: string[];
load: boolean;
network: string;
noCache: boolean;
noCacheFilters: string[];
'no-cache': boolean;
'no-cache-filters': string[];
outputs: string[];
platforms: string[];
provenance: string;
@ -31,53 +32,72 @@ export interface Inputs {
push: boolean;
sbom: string;
secrets: string[];
secretEnvs: string[];
secretFiles: string[];
shmSize: string;
'secret-envs': string[];
'secret-files': string[];
'shm-size': string;
ssh: string[];
tags: string[];
target: string;
ulimit: string[];
githubToken: string;
'github-token': string;
}
export async function getInputs(): Promise<Inputs> {
return {
addHosts: Util.getInputList('add-hosts'),
'add-hosts': Util.getInputList('add-hosts'),
allow: Util.getInputList('allow'),
annotations: Util.getInputList('annotations', {ignoreComma: true}),
attests: Util.getInputList('attests', {ignoreComma: true}),
buildArgs: Util.getInputList('build-args', {ignoreComma: true}),
buildContexts: Util.getInputList('build-contexts', {ignoreComma: true}),
'build-args': Util.getInputList('build-args', {ignoreComma: true}),
'build-contexts': Util.getInputList('build-contexts', {ignoreComma: true}),
builder: core.getInput('builder'),
cacheFrom: Util.getInputList('cache-from', {ignoreComma: true}),
cacheTo: Util.getInputList('cache-to', {ignoreComma: true}),
cgroupParent: core.getInput('cgroup-parent'),
'cache-from': Util.getInputList('cache-from', {ignoreComma: true}),
'cache-to': Util.getInputList('cache-to', {ignoreComma: true}),
'cgroup-parent': core.getInput('cgroup-parent'),
context: core.getInput('context') || Context.gitContext(),
file: core.getInput('file'),
labels: Util.getInputList('labels', {ignoreComma: true}),
load: core.getBooleanInput('load'),
network: core.getInput('network'),
noCache: core.getBooleanInput('no-cache'),
noCacheFilters: Util.getInputList('no-cache-filters'),
'no-cache': core.getBooleanInput('no-cache'),
'no-cache-filters': Util.getInputList('no-cache-filters'),
outputs: Util.getInputList('outputs', {ignoreComma: true, quote: false}),
platforms: Util.getInputList('platforms'),
provenance: BuildxInputs.getProvenanceInput('provenance'),
provenance: Build.getProvenanceInput('provenance'),
pull: core.getBooleanInput('pull'),
push: core.getBooleanInput('push'),
sbom: core.getInput('sbom'),
secrets: Util.getInputList('secrets', {ignoreComma: true}),
secretEnvs: Util.getInputList('secret-envs'),
secretFiles: Util.getInputList('secret-files', {ignoreComma: true}),
shmSize: core.getInput('shm-size'),
'secret-envs': Util.getInputList('secret-envs'),
'secret-files': Util.getInputList('secret-files', {ignoreComma: true}),
'shm-size': core.getInput('shm-size'),
ssh: Util.getInputList('ssh'),
tags: Util.getInputList('tags'),
target: core.getInput('target'),
ulimit: Util.getInputList('ulimit', {ignoreComma: true}),
githubToken: core.getInput('github-token')
'github-token': core.getInput('github-token')
};
}
export function sanitizeInputs(inputs: Inputs) {
const res = {};
for (const key of Object.keys(inputs)) {
if (key === 'github-token') {
continue;
}
const value: string | string[] | boolean = inputs[key];
if (typeof value === 'boolean' && value === false) {
continue;
} else if (Array.isArray(value) && value.length === 0) {
continue;
} else if (!value) {
continue;
}
res[key] = value;
}
return res;
}
export async function getArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
const context = handlebars.compile(inputs.context)({
defaultContext: Context.gitContext()
@ -92,19 +112,12 @@ export async function getArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<s
async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit): Promise<Array<string>> {
const args: Array<string> = ['build'];
await Util.asyncForEach(inputs.addHosts, async addHost => {
await Util.asyncForEach(inputs['add-hosts'], async addHost => {
args.push('--add-host', addHost);
});
if (inputs.allow.length > 0) {
args.push('--allow', inputs.allow.join(','));
}
if (await toolkit.buildx.versionSatisfies('>=0.10.0')) {
await Util.asyncForEach(inputs.attests, async attest => {
args.push('--attest', attest);
});
} else if (inputs.attests.length > 0) {
core.warning("Attestations are only supported by buildx >= 0.10.0; the input 'attests' is ignored.");
}
if (await toolkit.buildx.versionSatisfies('>=0.12.0')) {
await Util.asyncForEach(inputs.annotations, async annotation => {
args.push('--annotation', annotation);
@ -112,28 +125,28 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
} else if (inputs.annotations.length > 0) {
core.warning("Annotations are only supported by buildx >= 0.12.0; the input 'annotations' is ignored.");
}
await Util.asyncForEach(inputs.buildArgs, async buildArg => {
await Util.asyncForEach(inputs['build-args'], async buildArg => {
args.push('--build-arg', buildArg);
});
if (await toolkit.buildx.versionSatisfies('>=0.8.0')) {
await Util.asyncForEach(inputs.buildContexts, async buildContext => {
await Util.asyncForEach(inputs['build-contexts'], async buildContext => {
args.push('--build-context', buildContext);
});
} else if (inputs.buildContexts.length > 0) {
} else if (inputs['build-contexts'].length > 0) {
core.warning("Build contexts are only supported by buildx >= 0.8.0; the input 'build-contexts' is ignored.");
}
await Util.asyncForEach(inputs.cacheFrom, async cacheFrom => {
await Util.asyncForEach(inputs['cache-from'], async cacheFrom => {
args.push('--cache-from', cacheFrom);
});
await Util.asyncForEach(inputs.cacheTo, async cacheTo => {
await Util.asyncForEach(inputs['cache-to'], async cacheTo => {
args.push('--cache-to', cacheTo);
});
if (inputs.cgroupParent) {
args.push('--cgroup-parent', inputs.cgroupParent);
if (inputs['cgroup-parent']) {
args.push('--cgroup-parent', inputs['cgroup-parent']);
}
await Util.asyncForEach(inputs.secretEnvs, async secretEnv => {
await Util.asyncForEach(inputs['secret-envs'], async secretEnv => {
try {
args.push('--secret', BuildxInputs.resolveBuildSecretEnv(secretEnv));
args.push('--secret', Build.resolveSecretEnv(secretEnv));
} catch (err) {
core.warning(err.message);
}
@ -141,13 +154,13 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
if (inputs.file) {
args.push('--file', inputs.file);
}
if (!BuildxInputs.hasLocalExporter(inputs.outputs) && !BuildxInputs.hasTarExporter(inputs.outputs) && (inputs.platforms.length == 0 || (await toolkit.buildx.versionSatisfies('>=0.4.2')))) {
args.push('--iidfile', BuildxInputs.getBuildImageIDFilePath());
if (!Build.hasLocalExporter(inputs.outputs) && !Build.hasTarExporter(inputs.outputs) && (inputs.platforms.length == 0 || (await toolkit.buildx.versionSatisfies('>=0.4.2')))) {
args.push('--iidfile', toolkit.buildxBuild.getImageIDFilePath());
}
await Util.asyncForEach(inputs.labels, async label => {
args.push('--label', label);
});
await Util.asyncForEach(inputs.noCacheFilters, async noCacheFilter => {
await Util.asyncForEach(inputs['no-cache-filters'], async noCacheFilter => {
args.push('--no-cache-filter', noCacheFilter);
});
await Util.asyncForEach(inputs.outputs, async output => {
@ -157,46 +170,29 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
args.push('--platform', inputs.platforms.join(','));
}
if (await toolkit.buildx.versionSatisfies('>=0.10.0')) {
if (inputs.provenance) {
args.push('--provenance', inputs.provenance);
} else if ((await toolkit.buildkit.versionSatisfies(inputs.builder, '>=0.11.0')) && !BuildxInputs.hasDockerExporter(inputs.outputs, inputs.load)) {
// if provenance not specified and BuildKit version compatible for
// attestation, set default provenance. Also needs to make sure user
// doesn't want to explicitly load the image to docker.
if (GitHub.context.payload.repository?.private ?? false) {
// if this is a private repository, we set the default provenance
// attributes being set in buildx: https://github.com/docker/buildx/blob/fb27e3f919dcbf614d7126b10c2bc2d0b1927eb6/build/build.go#L603
args.push('--provenance', BuildxInputs.resolveProvenanceAttrs(`mode=min,inline-only=true`));
} else {
// for a public repository, we set max provenance mode.
args.push('--provenance', BuildxInputs.resolveProvenanceAttrs(`mode=max`));
}
}
if (inputs.sbom) {
args.push('--sbom', inputs.sbom);
}
} else if (inputs.provenance || inputs.sbom) {
core.warning("Attestations are only supported by buildx >= 0.10.0; the inputs 'provenance' and 'sbom' are ignored.");
args.push(...(await getAttestArgs(inputs, toolkit)));
} else {
core.warning("Attestations are only supported by buildx >= 0.10.0; the inputs 'attests', 'provenance' and 'sbom' are ignored.");
}
await Util.asyncForEach(inputs.secrets, async secret => {
try {
args.push('--secret', BuildxInputs.resolveBuildSecretString(secret));
args.push('--secret', Build.resolveSecretString(secret));
} catch (err) {
core.warning(err.message);
}
});
await Util.asyncForEach(inputs.secretFiles, async secretFile => {
await Util.asyncForEach(inputs['secret-files'], async secretFile => {
try {
args.push('--secret', BuildxInputs.resolveBuildSecretFile(secretFile));
args.push('--secret', Build.resolveSecretFile(secretFile));
} catch (err) {
core.warning(err.message);
}
});
if (inputs.githubToken && !BuildxInputs.hasGitAuthTokenSecret(inputs.secrets) && context.startsWith(Context.gitContext())) {
args.push('--secret', BuildxInputs.resolveBuildSecretString(`GIT_AUTH_TOKEN=${inputs.githubToken}`));
if (inputs['github-token'] && !Build.hasGitAuthTokenSecret(inputs.secrets) && context.startsWith(Context.gitContext())) {
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN=${inputs['github-token']}`));
}
if (inputs.shmSize) {
args.push('--shm-size', inputs.shmSize);
if (inputs['shm-size']) {
args.push('--shm-size', inputs['shm-size']);
}
await Util.asyncForEach(inputs.ssh, async ssh => {
args.push('--ssh', ssh);
@ -222,12 +218,12 @@ async function getCommonArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<st
args.push('--load');
}
if (await toolkit.buildx.versionSatisfies('>=0.6.0')) {
args.push('--metadata-file', BuildxInputs.getBuildMetadataFilePath());
args.push('--metadata-file', toolkit.buildxBuild.getMetadataFilePath());
}
if (inputs.network) {
args.push('--network', inputs.network);
}
if (inputs.noCache) {
if (inputs['no-cache']) {
args.push('--no-cache');
}
if (inputs.pull) {
@ -238,3 +234,52 @@ async function getCommonArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<st
}
return args;
}
async function getAttestArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
const args: Array<string> = [];
// check if provenance attestation is set in attests input
let hasAttestProvenance = false;
await Util.asyncForEach(inputs.attests, async (attest: string) => {
if (Build.hasAttestationType('provenance', attest)) {
hasAttestProvenance = true;
}
});
let provenanceSet = false;
let sbomSet = false;
if (inputs.provenance) {
args.push('--attest', Build.resolveAttestationAttrs(`type=provenance,${inputs.provenance}`));
provenanceSet = true;
} else if (!hasAttestProvenance && (await toolkit.buildkit.versionSatisfies(inputs.builder, '>=0.11.0')) && !Build.hasDockerExporter(inputs.outputs, inputs.load)) {
// if provenance not specified in provenance or attests inputs and BuildKit
// version compatible for attestation, set default provenance. Also needs
// to make sure user doesn't want to explicitly load the image to docker.
if (GitHub.context.payload.repository?.private ?? false) {
// if this is a private repository, we set the default provenance
// attributes being set in buildx: https://github.com/docker/buildx/blob/fb27e3f919dcbf614d7126b10c2bc2d0b1927eb6/build/build.go#L603
args.push('--attest', `type=provenance,${Build.resolveProvenanceAttrs(`mode=min,inline-only=true`)}`);
} else {
// for a public repository, we set max provenance mode.
args.push('--attest', `type=provenance,${Build.resolveProvenanceAttrs(`mode=max`)}`);
}
}
if (inputs.sbom) {
args.push('--attest', Build.resolveAttestationAttrs(`type=sbom,${inputs.sbom}`));
sbomSet = true;
}
// set attests but check if provenance or sbom types already set as
// provenance and sbom inputs take precedence over attests input.
await Util.asyncForEach(inputs.attests, async (attest: string) => {
if (!Build.hasAttestationType('provenance', attest) && !Build.hasAttestationType('sbom', attest)) {
args.push('--attest', Build.resolveAttestationAttrs(attest));
} else if (!provenanceSet && Build.hasAttestationType('provenance', attest)) {
args.push('--attest', Build.resolveProvenanceAttrs(attest));
} else if (!sbomSet && Build.hasAttestationType('sbom', attest)) {
args.push('--attest', attest);
}
});
return args;
}

View File

@ -3,21 +3,29 @@ import * as path from 'path';
import * as stateHelper from './state-helper';
import * as core from '@actions/core';
import * as actionsToolkit from '@docker/actions-toolkit';
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
import {History as BuildxHistory} from '@docker/actions-toolkit/lib/buildx/history';
import {Context} from '@docker/actions-toolkit/lib/context';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {Exec} from '@docker/actions-toolkit/lib/exec';
import {GitHub} from '@docker/actions-toolkit/lib/github';
import {Inputs as BuildxInputs} from '@docker/actions-toolkit/lib/buildx/inputs';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
import {ConfigFile} from '@docker/actions-toolkit/lib/types/docker';
import {Util} from '@docker/actions-toolkit/lib/util';
import {BuilderInfo} from '@docker/actions-toolkit/lib/types/buildx/builder';
import {ConfigFile} from '@docker/actions-toolkit/lib/types/docker/docker';
import {UploadArtifactResponse} from '@docker/actions-toolkit/lib/types/github';
import * as context from './context';
actionsToolkit.run(
// main
async () => {
const startedTime = new Date();
const inputs: context.Inputs = await context.getInputs();
core.debug(`inputs: ${JSON.stringify(inputs)}`);
stateHelper.setInputs(inputs);
const toolkit = new Toolkit();
@ -74,6 +82,12 @@ actionsToolkit.run(
await toolkit.buildx.printVersion();
});
let builder: BuilderInfo;
await core.group(`Builder info`, async () => {
builder = await toolkit.builder.inspect(inputs.builder);
core.info(JSON.stringify(builder, null, 2));
});
const args: string[] = await context.getArgs(inputs, toolkit);
core.debug(`context.getArgs: ${JSON.stringify(args)}`);
@ -81,18 +95,18 @@ actionsToolkit.run(
core.debug(`buildCmd.command: ${buildCmd.command}`);
core.debug(`buildCmd.args: ${JSON.stringify(buildCmd.args)}`);
let err: Error | undefined;
await Exec.getExecOutput(buildCmd.command, buildCmd.args, {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(`buildx failed with: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
err = Error(`buildx failed with: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
}
});
const imageID = BuildxInputs.resolveBuildImageID();
const metadata = BuildxInputs.resolveBuildMetadata();
const digest = BuildxInputs.resolveDigest();
const imageID = toolkit.buildxBuild.resolveImageID();
const metadata = toolkit.buildxBuild.resolveMetadata();
const digest = toolkit.buildxBuild.resolveDigest();
if (imageID) {
await core.group(`ImageID`, async () => {
core.info(imageID);
@ -107,13 +121,80 @@ actionsToolkit.run(
}
if (metadata) {
await core.group(`Metadata`, async () => {
core.info(metadata);
core.setOutput('metadata', metadata);
const metadatadt = JSON.stringify(metadata, null, 2);
core.info(metadatadt);
core.setOutput('metadata', metadatadt);
});
}
let ref: string;
await core.group(`Reference`, async () => {
ref = await buildRef(toolkit, startedTime, inputs.builder);
if (ref) {
core.info(ref);
stateHelper.setBuildRef(ref);
} else {
core.info('No build reference found');
}
});
await core.group(`Check build summary support`, async () => {
if (!buildSummaryEnabled()) {
core.info('Build summary disabled');
} else if (GitHub.isGHES) {
core.warning('Build summary is not yet supported on GHES');
} else if (!(await toolkit.buildx.versionSatisfies('>=0.13.0'))) {
core.warning('Build summary requires Buildx >= 0.13.0');
} else if (builder && builder.driver === 'cloud') {
core.warning('Build summary is not yet supported with Docker Build Cloud');
} else if (!ref) {
core.warning('Build summary requires a build reference');
} else {
core.info('Build summary supported!');
stateHelper.setSummarySupported();
}
});
if (err) {
throw err;
}
},
// post
async () => {
if (stateHelper.isSummarySupported) {
await core.group(`Generating build summary`, async () => {
try {
const recordUploadEnabled = buildRecordUploadEnabled();
let recordRetentionDays: number | undefined;
if (recordUploadEnabled) {
recordRetentionDays = buildRecordRetentionDays();
}
const buildxHistory = new BuildxHistory();
const exportRes = await buildxHistory.export({
refs: stateHelper.buildRef ? [stateHelper.buildRef] : []
});
core.info(`Build record written to ${exportRes.dockerbuildFilename} (${Util.formatFileSize(exportRes.dockerbuildSize)})`);
let uploadRes: UploadArtifactResponse | undefined;
if (recordUploadEnabled) {
uploadRes = await GitHub.uploadArtifact({
filename: exportRes.dockerbuildFilename,
mimeType: 'application/gzip',
retentionDays: recordRetentionDays
});
}
await GitHub.writeBuildSummary({
exportRes: exportRes,
uploadRes: uploadRes,
inputs: stateHelper.inputs
});
} catch (e) {
core.warning(e.message);
}
});
}
if (stateHelper.tmpDir.length > 0) {
await core.group(`Removing temp folder ${stateHelper.tmpDir}`, async () => {
fs.rmSync(stateHelper.tmpDir, {recursive: true});
@ -121,3 +202,56 @@ actionsToolkit.run(
}
}
);
async function buildRef(toolkit: Toolkit, since: Date, builder?: string): Promise<string> {
// get ref from metadata file
const ref = toolkit.buildxBuild.resolveRef();
if (ref) {
return ref;
}
// otherwise, look for the very first build ref since the build has started
if (!builder) {
const currentBuilder = await toolkit.builder.inspect();
builder = currentBuilder.name;
}
const refs = Buildx.refs({
dir: Buildx.refsDir,
builderName: builder,
since: since
});
return Object.keys(refs).length > 0 ? Object.keys(refs)[0] : '';
}
function buildSummaryEnabled(): boolean {
if (process.env.DOCKER_BUILD_NO_SUMMARY) {
core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Set DOCKER_BUILD_SUMMARY to false instead.');
return !Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
} else if (process.env.DOCKER_BUILD_SUMMARY) {
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY);
}
return true;
}
function buildRecordUploadEnabled(): boolean {
if (process.env.DOCKER_BUILD_RECORD_UPLOAD) {
return Util.parseBool(process.env.DOCKER_BUILD_RECORD_UPLOAD);
}
return true;
}
function buildRecordRetentionDays(): number | undefined {
let val: string | undefined;
if (process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS) {
core.warning('DOCKER_BUILD_EXPORT_RETENTION_DAYS is deprecated. Use DOCKER_BUILD_RECORD_RETENTION_DAYS instead.');
val = process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS;
} else if (process.env.DOCKER_BUILD_RECORD_RETENTION_DAYS) {
val = process.env.DOCKER_BUILD_RECORD_RETENTION_DAYS;
}
if (val) {
const res = parseInt(val);
if (isNaN(res)) {
throw Error(`Invalid build record retention days: ${val}`);
}
return res;
}
}

View File

@ -1,7 +1,24 @@
import * as core from '@actions/core';
import {Inputs, sanitizeInputs} from './context';
export const tmpDir = process.env['STATE_tmpDir'] || '';
export const inputs = process.env['STATE_inputs'] ? JSON.parse(process.env['STATE_inputs']) : undefined;
export const buildRef = process.env['STATE_buildRef'] || '';
export const isSummarySupported = !!process.env['STATE_isSummarySupported'];
export function setTmpDir(tmpDir: string) {
core.saveState('tmpDir', tmpDir);
}
export function setInputs(inputs: Inputs) {
core.saveState('inputs', JSON.stringify(sanitizeInputs(inputs)));
}
export function setBuildRef(buildRef: string) {
core.saveState('buildRef', buildRef);
}
export function setSummarySupported() {
core.saveState('isSummarySupported', 'true');
}

10979
yarn.lock

File diff suppressed because it is too large Load Diff