mirror of
https://github.com/docker/setup-docker-action.git
synced 2026-07-16 11:50:08 -05:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a2470b712 | |||
| c73af0b2a4 | |||
| f6114d22a8 | |||
| 4fc03ecc67 | |||
| 55628a5aa4 | |||
| ffada020d6 | |||
| af897d3ae5 | |||
| 068a24b68f | |||
| d264b5decd | |||
| 1ce1eeba96 | |||
| c92adf7de8 | |||
| 9b75a73943 | |||
| 6852d5f281 | |||
| 62121a8f70 | |||
| 412f770366 | |||
| 7f9d88cd0b | |||
| 0e1a7c6a5c | |||
| 737579f550 | |||
| 0dc6ac338c | |||
| 4053da9e9d |
@@ -163,13 +163,13 @@ jobs:
|
||||
docker run -d -p 5000:5000 --restart=always --name registry registry:2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
|
||||
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
|
||||
with:
|
||||
driver: docker
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||
with:
|
||||
context: ./test
|
||||
push: true
|
||||
@@ -202,13 +202,13 @@ jobs:
|
||||
docker run -d -p 5000:5000 --restart=always --name registry registry:2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
|
||||
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
|
||||
with:
|
||||
driver: docker
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||
with:
|
||||
context: ./test
|
||||
push: true
|
||||
|
||||
@@ -35,12 +35,12 @@ jobs:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
-
|
||||
name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
|
||||
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
|
||||
with:
|
||||
languages: javascript-typescript
|
||||
build-mode: none
|
||||
-
|
||||
name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
|
||||
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
|
||||
with:
|
||||
category: "/language:javascript-typescript"
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
||||
with:
|
||||
source: .
|
||||
targets: test
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
name: update-deps
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 9 * * *'
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-24.04
|
||||
environment: update-deps # secrets are gated by this environment
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
dep:
|
||||
- regctl
|
||||
- undock
|
||||
steps:
|
||||
-
|
||||
name: GitHub auth token from GitHub App
|
||||
id: write-app
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
with:
|
||||
client-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
|
||||
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
|
||||
owner: docker
|
||||
repositories: setup-docker-action
|
||||
permission-contents: write
|
||||
permission-pull-requests: write
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
token: ${{ steps.write-app.outputs.token }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
-
|
||||
name: Update dependency
|
||||
id: update
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
env:
|
||||
INPUT_DEP: ${{ matrix.dep }}
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const dep = core.getInput('dep', {required: true});
|
||||
|
||||
function escapeRegExp(value) {
|
||||
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
}
|
||||
|
||||
function tsConstStringPattern(key) {
|
||||
return new RegExp(`^(const ${escapeRegExp(key)} = ')([^']*)(';)$`, 'm');
|
||||
}
|
||||
|
||||
async function readJsonFromActionsToolkit(relativePath) {
|
||||
const response = await github.rest.repos.getContent({
|
||||
owner: 'docker',
|
||||
repo: 'actions-toolkit',
|
||||
path: relativePath,
|
||||
ref: 'main'
|
||||
});
|
||||
if (Array.isArray(response.data) || response.data.type !== 'file') {
|
||||
throw new Error(`Expected ${relativePath} to be a file`);
|
||||
}
|
||||
return JSON.parse(Buffer.from(response.data.content, response.data.encoding).toString('utf8'));
|
||||
}
|
||||
|
||||
async function readLatestTag(relativePath) {
|
||||
const tag = (await readJsonFromActionsToolkit(relativePath))?.latest?.tag_name;
|
||||
if (!tag) {
|
||||
throw new Error(`Unable to resolve latest tag from ${relativePath}`);
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
const dependencyConfigs = {
|
||||
regctl: {
|
||||
name: 'Regctl version',
|
||||
branch: 'deps/regctl-version',
|
||||
sourcePath: '.github/regclient-releases.json',
|
||||
sourceUrl: 'https://github.com/docker/actions-toolkit/blob/main/.github/regclient-releases.json',
|
||||
key: 'regctlDefaultVersion'
|
||||
},
|
||||
undock: {
|
||||
name: 'Undock version',
|
||||
branch: 'deps/undock-version',
|
||||
sourcePath: '.github/undock-releases.json',
|
||||
sourceUrl: 'https://github.com/docker/actions-toolkit/blob/main/.github/undock-releases.json',
|
||||
key: 'undockDefaultVersion'
|
||||
}
|
||||
};
|
||||
|
||||
const config = dependencyConfigs[dep];
|
||||
if (!config) {
|
||||
core.setFailed(`Unknown dependency ${dep}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const version = await readLatestTag(config.sourcePath);
|
||||
const targetPath = 'src/main.ts';
|
||||
const absolutePath = path.join(process.env.GITHUB_WORKSPACE, targetPath);
|
||||
const content = fs.readFileSync(absolutePath, 'utf8');
|
||||
const pattern = tsConstStringPattern(config.key);
|
||||
const match = content.match(pattern);
|
||||
if (!match) {
|
||||
throw new Error(`Missing ${config.key} in ${targetPath}`);
|
||||
}
|
||||
|
||||
const previousVersion = match[2];
|
||||
const changed = previousVersion !== version;
|
||||
if (changed) {
|
||||
fs.writeFileSync(
|
||||
absolutePath,
|
||||
content.replace(pattern, `$1${version}$3`),
|
||||
'utf8'
|
||||
);
|
||||
core.info(`New ${config.name} ${version} found`);
|
||||
} else {
|
||||
core.info(`No workspace changes needed for ${config.name}`);
|
||||
}
|
||||
|
||||
core.info(`Resolved ${config.name} from ${config.sourceUrl}`);
|
||||
core.setOutput('changed', String(changed));
|
||||
core.setOutput('branch', config.branch);
|
||||
core.setOutput('title', `chore(deps): update ${config.name} from ${previousVersion} to ${version}`);
|
||||
core.setOutput('before', previousVersion);
|
||||
core.setOutput('after', version);
|
||||
core.setOutput('source-url', config.sourceUrl);
|
||||
-
|
||||
name: Build
|
||||
if: steps.update.outputs.changed == 'true'
|
||||
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
||||
with:
|
||||
source: .
|
||||
targets: build
|
||||
-
|
||||
name: Create pull request
|
||||
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
||||
with:
|
||||
base: master
|
||||
branch: ${{ steps.update.outputs.branch }}
|
||||
token: ${{ steps.write-app.outputs.token }}
|
||||
commit-message: ${{ steps.update.outputs.title }}
|
||||
title: ${{ steps.update.outputs.title }}
|
||||
signoff: true
|
||||
sign-commits: true
|
||||
delete-branch: true
|
||||
body: |
|
||||
This updates the pinned default in `src/main.ts` from `${{ steps.update.outputs.before }}` to `${{ steps.update.outputs.after }}` and refreshes generated `dist` content.
|
||||
|
||||
The source of truth for this update is ${{ steps.update.outputs.source-url }}.
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
token: ${{ steps.docker-read-app.outputs.token }}
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
||||
with:
|
||||
source: .
|
||||
targets: build
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
-
|
||||
name: Generate matrix
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/matrix@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
uses: docker/bake-action/subaction/matrix@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
||||
with:
|
||||
target: validate
|
||||
|
||||
@@ -41,6 +41,6 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
+68
-68
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+3
-3
@@ -216,7 +216,7 @@ Apache License
|
||||
|
||||
The following npm package may be included in this product:
|
||||
|
||||
- @docker/actions-toolkit@0.92.0
|
||||
- @docker/actions-toolkit@0.93.0
|
||||
|
||||
This package contains the following license:
|
||||
|
||||
@@ -1792,7 +1792,7 @@ SOFTWARE.
|
||||
|
||||
The following npm package may be included in this product:
|
||||
|
||||
- js-yaml@5.2.0
|
||||
- js-yaml@5.2.1
|
||||
|
||||
This package contains the following license:
|
||||
|
||||
@@ -4187,7 +4187,7 @@ THE SOFTWARE.
|
||||
|
||||
The following npm package may be included in this product:
|
||||
|
||||
- csv-parse@7.0.0
|
||||
- csv-parse@7.0.1
|
||||
|
||||
This package contains the following license:
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
"packageManager": "yarn@4.15.0",
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.1",
|
||||
"@docker/actions-toolkit": "^0.92.0"
|
||||
"@docker/actions-toolkit": "^0.93.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.3",
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ import {Install as UndockInstall} from '@docker/actions-toolkit/lib/undock/insta
|
||||
import * as context from './context.js';
|
||||
import * as stateHelper from './state-helper.js';
|
||||
|
||||
const regctlDefaultVersion = 'v0.8.3';
|
||||
const undockDefaultVersion = 'v0.10.0';
|
||||
const regctlDefaultVersion = 'v0.11.5';
|
||||
const undockDefaultVersion = 'v0.14.0';
|
||||
|
||||
actionsToolkit.run(
|
||||
// main
|
||||
|
||||
@@ -436,9 +436,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@docker/actions-toolkit@npm:^0.92.0":
|
||||
version: 0.92.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.92.0"
|
||||
"@docker/actions-toolkit@npm:^0.93.0":
|
||||
version: 0.93.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.93.0"
|
||||
dependencies:
|
||||
"@actions/artifact": "npm:^6.2.1"
|
||||
"@actions/cache": "npm:^6.1.0"
|
||||
@@ -452,16 +452,16 @@ __metadata:
|
||||
"@sigstore/tuf": "npm:^5.0.0"
|
||||
"@sigstore/verify": "npm:^4.1.0"
|
||||
async-retry: "npm:^1.3.3"
|
||||
csv-parse: "npm:^7.0.0"
|
||||
csv-parse: "npm:^7.0.1"
|
||||
gunzip-maybe: "npm:^1.4.2"
|
||||
handlebars: "npm:^4.7.9"
|
||||
he: "npm:^1.2.0"
|
||||
js-yaml: "npm:^5.2.0"
|
||||
js-yaml: "npm:^5.2.1"
|
||||
jwt-decode: "npm:^4.0.0"
|
||||
semver: "npm:^7.8.5"
|
||||
tar-stream: "npm:^3.2.0"
|
||||
tmp: "npm:^0.2.7"
|
||||
checksum: 10/599cea84b897069c53744a2f05371c6d9ad60da18448b4431273529b92fd2d77ddc718ee205cf0bf1da53083d412da90b1067f1e64a5fdac73fe71d486726064
|
||||
checksum: 10/31643db575faf865666247661007d6e5fc8bc2b737001a522879829fcbeeab7b11b886d2cc26d074a26814361ec8427484d7b94ad9155d52c41398a7dc27000e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2828,10 +2828,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"csv-parse@npm:^7.0.0":
|
||||
version: 7.0.0
|
||||
resolution: "csv-parse@npm:7.0.0"
|
||||
checksum: 10/53c96e6b4ff80047713bb4d2967d06495890d4b628284a80271860be089fdb5a74cd97c76fd535a00ad26b11cc6e4fc5a243658e5377c0a6334ddd104620d169
|
||||
"csv-parse@npm:^7.0.1":
|
||||
version: 7.0.1
|
||||
resolution: "csv-parse@npm:7.0.1"
|
||||
checksum: 10/5c914f01181dbb381068b98e17b49361d853faa95db3e8e82bc96b6a0de5313ecc8325a77db35ff66644d7747099965ba3167ec21bd9ce4500edf21b5bdd49bf
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2887,7 +2887,7 @@ __metadata:
|
||||
resolution: "docker-setup-docker@workspace:."
|
||||
dependencies:
|
||||
"@actions/core": "npm:^3.0.1"
|
||||
"@docker/actions-toolkit": "npm:^0.92.0"
|
||||
"@docker/actions-toolkit": "npm:^0.93.0"
|
||||
"@eslint/js": "npm:^9.39.3"
|
||||
"@types/node": "npm:^24.11.0"
|
||||
"@typescript-eslint/eslint-plugin": "npm:^8.56.1"
|
||||
@@ -4162,14 +4162,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"js-yaml@npm:^5.2.0":
|
||||
version: 5.2.0
|
||||
resolution: "js-yaml@npm:5.2.0"
|
||||
"js-yaml@npm:^5.2.1":
|
||||
version: 5.2.1
|
||||
resolution: "js-yaml@npm:5.2.1"
|
||||
dependencies:
|
||||
argparse: "npm:^2.0.1"
|
||||
bin:
|
||||
js-yaml: bin/js-yaml.mjs
|
||||
checksum: 10/8a5e55c5d0fcafae4ac02114a99dc070048b8e5a82a056089ce1f69f8a00fd8eb05b622e76ad50aac1f9d409010636c9616c6b2ed4e58dae138379a60d301220
|
||||
checksum: 10/e1eca2d21c15572585bb236d9fde31d6789eb50b9c63e8753fa7e0777bc480f7521cad517bd7a0c66f27dfc27ddcd7100beeefa51c1a50e10e98f2e009633c3d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user