Compare commits
	
		
			19 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					15560696de | ||
| 
						 | 
					57e1d34ac3 | ||
| 
						 | 
					309982ebc9 | ||
| 
						 | 
					9476c25b2a | ||
| 
						 | 
					97be5a4928 | ||
| 
						 | 
					9cac6c8ea0 | ||
| 
						 | 
					31159d49c0 | ||
| 
						 | 
					07e1c3e148 | ||
| 
						 | 
					f7febd621d | ||
| 
						 | 
					f6010ea701 | ||
| 
						 | 
					c0a6b9680f | ||
| 
						 | 
					0dfe9c3d41 | ||
| 
						 | 
					94f8f8c2ee | ||
| 
						 | 
					22f4433c58 | ||
| 
						 | 
					6721c56015 | ||
| 
						 | 
					4367da978b | ||
| 
						 | 
					0883ebe52d | ||
| 
						 | 
					76e5c2d6ea | ||
| 
						 | 
					29d67824d8 | 
							
								
								
									
										29
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										29
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@@ -1367,3 +1367,32 @@ jobs:
 | 
			
		||||
          file: ./test/Dockerfile
 | 
			
		||||
        env:
 | 
			
		||||
          DOCKER_BUILD_NO_SUMMARY: true
 | 
			
		||||
 | 
			
		||||
  export-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_EXPORT_RETENTION_DAYS: ${{ matrix.days }}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							@@ -20,7 +20,7 @@ jobs:
 | 
			
		||||
        uses: actions/checkout@v4
 | 
			
		||||
      -
 | 
			
		||||
        name: Test
 | 
			
		||||
        uses: docker/bake-action@v4
 | 
			
		||||
        uses: docker/bake-action@v5
 | 
			
		||||
        with:
 | 
			
		||||
          targets: test
 | 
			
		||||
      -
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/validate.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/validate.yml
									
									
									
									
										vendored
									
									
								
							@@ -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 }}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								README.md
									
									
									
									
									
								
							@@ -90,7 +90,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
 | 
			
		||||
@@ -115,7 +115,7 @@ to the default Git context:
 | 
			
		||||
        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
 | 
			
		||||
@@ -130,7 +130,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
 | 
			
		||||
@@ -169,7 +169,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
 | 
			
		||||
@@ -259,9 +259,10 @@ The following outputs are available:
 | 
			
		||||
 | 
			
		||||
### environment variables
 | 
			
		||||
 | 
			
		||||
| Name                      | Type | Description                                                                                                       |
 | 
			
		||||
|---------------------------|------|-------------------------------------------------------------------------------------------------------------------|
 | 
			
		||||
| `DOCKER_BUILD_NO_SUMMARY` | Bool | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled |
 | 
			
		||||
| Name                                 | Type   | Description                                                                                                                                                                                                                                                        |
 | 
			
		||||
|--------------------------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
 | 
			
		||||
| `DOCKER_BUILD_NO_SUMMARY`            | Bool   | If `true`, [build summary](https://docs.docker.com/build/ci/github-actions/build-summary/) generation is disabled                                                                                                                                                  |
 | 
			
		||||
| `DOCKER_BUILD_EXPORT_RETENTION_DAYS` | Number | Duration after which build export 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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										23
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										23
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										24
									
								
								dist/licenses.txt
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								dist/licenses.txt
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -2516,6 +2516,30 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
THE SOFTWARE.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
he
 | 
			
		||||
MIT
 | 
			
		||||
Copyright Mathias Bynens <https://mathiasbynens.be/>
 | 
			
		||||
 | 
			
		||||
Permission is hereby granted, free of charge, to any person obtaining
 | 
			
		||||
a copy of this software and associated documentation files (the
 | 
			
		||||
"Software"), to deal in the Software without restriction, including
 | 
			
		||||
without limitation the rights to use, copy, modify, merge, publish,
 | 
			
		||||
distribute, sublicense, and/or sell copies of the Software, and to
 | 
			
		||||
permit persons to whom the Software is furnished to do so, subject to
 | 
			
		||||
the following conditions:
 | 
			
		||||
 | 
			
		||||
The above copyright notice and this permission notice shall be
 | 
			
		||||
included in all copies or substantial portions of the Software.
 | 
			
		||||
 | 
			
		||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
			
		||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 | 
			
		||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 | 
			
		||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 | 
			
		||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 | 
			
		||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 | 
			
		||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
iconv-lite
 | 
			
		||||
MIT
 | 
			
		||||
Copyright (c) 2011 Alexander Shtuchkin
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@
 | 
			
		||||
  "packageManager": "yarn@3.6.3",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@actions/core": "^1.10.1",
 | 
			
		||||
    "@docker/actions-toolkit": "0.26.0",
 | 
			
		||||
    "@docker/actions-toolkit": "0.28.0",
 | 
			
		||||
    "handlebars": "^4.7.7"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								src/main.ts
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/main.ts
									
									
									
									
									
								
							@@ -151,6 +151,7 @@ actionsToolkit.run(
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        try {
 | 
			
		||||
          const exportRetentionDays = buildExportRetentionDays();
 | 
			
		||||
          const buildxHistory = new BuildxHistory();
 | 
			
		||||
          const exportRes = await buildxHistory.export({
 | 
			
		||||
            refs: [stateHelper.buildRef]
 | 
			
		||||
@@ -159,7 +160,7 @@ actionsToolkit.run(
 | 
			
		||||
          const uploadRes = await GitHub.uploadArtifact({
 | 
			
		||||
            filename: exportRes.dockerbuildFilename,
 | 
			
		||||
            mimeType: 'application/gzip',
 | 
			
		||||
            retentionDays: 90
 | 
			
		||||
            retentionDays: exportRetentionDays
 | 
			
		||||
          });
 | 
			
		||||
          await GitHub.writeBuildSummary({
 | 
			
		||||
            exportRes: exportRes,
 | 
			
		||||
@@ -197,3 +198,13 @@ async function buildRef(toolkit: Toolkit, since: Date, builder?: string): Promis
 | 
			
		||||
  });
 | 
			
		||||
  return Object.keys(refs).length > 0 ? Object.keys(refs)[0] : '';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function buildExportRetentionDays(): number | undefined {
 | 
			
		||||
  if (process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS) {
 | 
			
		||||
    const res = parseInt(process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS);
 | 
			
		||||
    if (isNaN(res)) {
 | 
			
		||||
      throw Error(`Invalid build export retention days: ${process.env.DOCKER_BUILD_EXPORT_RETENTION_DAYS}`);
 | 
			
		||||
    }
 | 
			
		||||
    return res;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								yarn.lock
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								yarn.lock
									
									
									
									
									
								
							@@ -1055,9 +1055,9 @@ __metadata:
 | 
			
		||||
  languageName: node
 | 
			
		||||
  linkType: hard
 | 
			
		||||
 | 
			
		||||
"@docker/actions-toolkit@npm:0.26.0":
 | 
			
		||||
  version: 0.26.0
 | 
			
		||||
  resolution: "@docker/actions-toolkit@npm:0.26.0"
 | 
			
		||||
"@docker/actions-toolkit@npm:0.28.0":
 | 
			
		||||
  version: 0.28.0
 | 
			
		||||
  resolution: "@docker/actions-toolkit@npm:0.28.0"
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@actions/artifact": ^2.1.7
 | 
			
		||||
    "@actions/cache": ^3.2.4
 | 
			
		||||
@@ -1074,12 +1074,13 @@ __metadata:
 | 
			
		||||
    csv-parse: ^5.5.6
 | 
			
		||||
    gunzip-maybe: ^1.4.2
 | 
			
		||||
    handlebars: ^4.7.8
 | 
			
		||||
    he: ^1.2.0
 | 
			
		||||
    js-yaml: ^4.1.0
 | 
			
		||||
    jwt-decode: ^4.0.0
 | 
			
		||||
    semver: ^7.6.2
 | 
			
		||||
    tar-stream: ^3.1.7
 | 
			
		||||
    tmp: ^0.2.3
 | 
			
		||||
  checksum: bc5b8311758a6cfed9e9f575cc18f70bd9b39316d7604e9b57ba7500e7a1c5b2034e29e9ada18187a7dac50f02f60f8fa257e30440b458417628efa4b7f254bb
 | 
			
		||||
  checksum: 1ef7d9eb861a8f102391b9b230a6cfae808ec12f48a97b32e8afe78e241e8d4c1faece71ad8f7702c7b1cfffaf0bd7f816552b6bad0b6d8a41465142a61425a6
 | 
			
		||||
  languageName: node
 | 
			
		||||
  linkType: hard
 | 
			
		||||
 | 
			
		||||
@@ -3149,7 +3150,7 @@ __metadata:
 | 
			
		||||
  resolution: "docker-build-push@workspace:."
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@actions/core": ^1.10.1
 | 
			
		||||
    "@docker/actions-toolkit": 0.26.0
 | 
			
		||||
    "@docker/actions-toolkit": 0.28.0
 | 
			
		||||
    "@types/node": ^20.12.12
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": ^7.9.0
 | 
			
		||||
    "@typescript-eslint/parser": ^7.9.0
 | 
			
		||||
@@ -3962,6 +3963,15 @@ __metadata:
 | 
			
		||||
  languageName: node
 | 
			
		||||
  linkType: hard
 | 
			
		||||
 | 
			
		||||
"he@npm:^1.2.0":
 | 
			
		||||
  version: 1.2.0
 | 
			
		||||
  resolution: "he@npm:1.2.0"
 | 
			
		||||
  bin:
 | 
			
		||||
    he: bin/he
 | 
			
		||||
  checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7
 | 
			
		||||
  languageName: node
 | 
			
		||||
  linkType: hard
 | 
			
		||||
 | 
			
		||||
"html-escaper@npm:^2.0.0":
 | 
			
		||||
  version: 2.0.2
 | 
			
		||||
  resolution: "html-escaper@npm:2.0.2"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user