Skip to content

Commit d93abab

Browse files
Merge pull request #202 from step-security/auto-cherry-pick
chore: Cherry-picked changes from upstream
2 parents c446085 + 5dcebba commit d93abab

File tree

10 files changed

+469
-258
lines changed

10 files changed

+469
-258
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- v27.3.1
3030
- type=image,tag=27.3.1
3131
include:
32-
- os: macos-13
32+
- os: macos-15-intel
3333
version: v27.3.1
3434
steps:
3535
- name: Harden Runner
@@ -53,7 +53,6 @@ jobs:
5353
matrix:
5454
os:
5555
- ubuntu-latest
56-
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
5756
- windows-latest
5857
steps:
5958
- name: Harden Runner
@@ -78,7 +77,6 @@ jobs:
7877
matrix:
7978
os:
8079
- ubuntu-latest
81-
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
8280
- windows-latest
8381
steps:
8482
- name: Harden Runner
@@ -108,8 +106,7 @@ jobs:
108106
matrix:
109107
os:
110108
- ubuntu-latest
111-
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
112-
- macos-13
109+
- macos-15-intel
113110
- windows-latest
114111
steps:
115112
- name: Harden Runner
@@ -132,8 +129,7 @@ jobs:
132129
docker context inspect foo
133130
134131
lima-start-args:
135-
#runs-on: macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
136-
runs-on: macos-13
132+
runs-on: macos-15-intel
137133
steps:
138134
- name: Harden Runner
139135
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
@@ -207,8 +203,7 @@ jobs:
207203
fail-fast: false
208204
matrix:
209205
os:
210-
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
211-
- macos-13
206+
- macos-15-intel
212207
steps:
213208
- name: Harden Runner
214209
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
@@ -322,8 +317,7 @@ jobs:
322317
matrix:
323318
os:
324319
- ubuntu-latest
325-
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
326-
- macos-13
320+
- macos-15-intel
327321
- windows-latest
328322
steps:
329323
-
@@ -374,7 +368,7 @@ jobs:
374368
matrix:
375369
os:
376370
- ubuntu-latest
377-
- macos-13
371+
- macos-15-intel
378372
- windows-latest
379373
steps:
380374
-

__tests__/context.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('getInputs', () => {
3434
rootless: false,
3535
setHost: false,
3636
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
37+
githubToken: '',
3738
} as context.Inputs
3839
],
3940
[
@@ -57,6 +58,7 @@ describe('getInputs', () => {
5758
rootless: false,
5859
setHost: false,
5960
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
61+
githubToken: '',
6062
} as context.Inputs
6163
],
6264
[
@@ -76,6 +78,7 @@ describe('getInputs', () => {
7678
rootless: false,
7779
setHost: true,
7880
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
81+
githubToken: '',
7982
} as context.Inputs
8083
],
8184
[
@@ -97,6 +100,7 @@ describe('getInputs', () => {
97100
rootless: false,
98101
setHost: false,
99102
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
103+
githubToken: '',
100104
} as context.Inputs
101105
],
102106
[
@@ -116,6 +120,7 @@ describe('getInputs', () => {
116120
rootless: false,
117121
setHost: false,
118122
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
123+
githubToken: '',
119124
} as context.Inputs
120125
],
121126
[
@@ -136,6 +141,7 @@ describe('getInputs', () => {
136141
daemonConfig: '',
137142
rootless: false,
138143
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
144+
githubToken: '',
139145
} as context.Inputs
140146
],
141147
[
@@ -156,6 +162,7 @@ describe('getInputs', () => {
156162
daemonConfig: '',
157163
rootless: false,
158164
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
165+
githubToken: '',
159166
} as context.Inputs
160167
],
161168
[
@@ -175,6 +182,7 @@ describe('getInputs', () => {
175182
daemonConfig: '',
176183
rootless: false,
177184
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
185+
githubToken: '',
178186
} as context.Inputs
179187
],
180188
[
@@ -194,6 +202,7 @@ describe('getInputs', () => {
194202
daemonConfig: '',
195203
rootless: true,
196204
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
205+
githubToken: '',
197206
} as context.Inputs
198207
],
199208
[
@@ -216,6 +225,7 @@ describe('getInputs', () => {
216225
rootless: false,
217226
setHost: false,
218227
runtimeBasedir: path.join(os.homedir(), `setup-docker-action`),
228+
githubToken: '',
219229
} as context.Inputs
220230
],
221231
])(

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ inputs:
3333
runtime-basedir:
3434
description: 'Docker runtime base directory'
3535
required: false
36+
github-token:
37+
description: "GitHub Token used to get releases and download assets"
38+
default: ${{ github.token }}
39+
required: false
3640

3741
outputs:
3842
sock:

dist/index.js

Lines changed: 17 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/licenses.txt

Lines changed: 0 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"license": "Apache-2.0",
2626
"dependencies": {
2727
"@actions/core": "^1.10.1",
28-
"@docker/actions-toolkit": "^0.64.0",
28+
"@docker/actions-toolkit": "^0.65.0",
2929
"uuid": "^10.0.0"
3030
},
3131
"devDependencies": {

src/context.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export interface Inputs {
1414
setHost: boolean;
1515
rootless: boolean;
1616
runtimeBasedir: string;
17+
githubToken: string;
1718
}
1819

1920
export function getInputs(): Inputs {
@@ -31,7 +32,8 @@ export function getInputs(): Inputs {
3132
context: core.getInput('context'),
3233
setHost: core.getBooleanInput('set-host'),
3334
rootless: core.getBooleanInput('rootless'),
34-
runtimeBasedir: core.getInput('runtime-basedir') || path.join(os.homedir(), `setup-docker-action`)
35+
runtimeBasedir: core.getInput('runtime-basedir') || path.join(os.homedir(), `setup-docker-action`),
36+
githubToken: core.getInput('github-token')
3537
};
3638
}
3739

src/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ actionsToolkit.run(
4343

4444
if (input.source.type === 'image') {
4545
await core.group(`Download and install regctl`, async () => {
46-
const regclientInstall = new RegclientInstall();
46+
const regclientInstall = new RegclientInstall({githubToken: input.githubToken});
4747
const regclientBinPath = await regclientInstall.download(
4848
process.env.REGCTL_VERSION && process.env.REGCTL_VERSION.trim()
4949
? process.env.REGCTL_VERSION
@@ -53,7 +53,7 @@ actionsToolkit.run(
5353
await regclientInstall.install(regclientBinPath);
5454
});
5555
await core.group(`Download and install undock`, async () => {
56-
const undockInstall = new UndockInstall();
56+
const undockInstall = new UndockInstall({githubToken: input.githubToken});
5757
const undockBinPath = await undockInstall.download(
5858
process.env.UNDOCK_VERSION && process.env.UNDOCK_VERSION.trim()
5959
? process.env.UNDOCK_VERSION
@@ -77,7 +77,8 @@ actionsToolkit.run(
7777
rootless: input.rootless,
7878
contextName: input.context || 'setup-docker-action',
7979
daemonConfig: input.daemonConfig,
80-
localTCPPort: tcpPort
80+
localTCPPort: tcpPort,
81+
githubToken: input.githubToken
8182
});
8283
let toolDir;
8384
if (!(await Docker.isAvailable()) || input.source) {

0 commit comments

Comments
 (0)