Skip to content

Commit d7ae78e

Browse files
authored
chore: update windows-image-roller for new arc cluster (#153)
1 parent a118d7e commit d7ae78e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/utils/arc-image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getOctokit } from './octokit';
44

55
const WINDOWS_RUNNER_REGEX = /ARG RUNNER_VERSION=([\d.]+)/;
66
const WINDOWS_IMAGE_REGEX =
7-
/electronarc\.azurecr\.io\/win-actions-runner:main-[a-f0-9]{7}@sha256:[a-f0-9]{64}/;
7+
/\$\{registry_name\}\.azurecr\.io\/win-actions-runner:main-[a-f0-9]{7}@sha256:[a-f0-9]{64}/;
88
const LINUX_IMAGE_REGEX =
99
/if eq .cpuArch "amd64".*\n.*image: ghcr.io\/actions\/actions-runner:([0-9]+\.[0-9]+\.[0-9]+@sha256:[a-f0-9]{64}).*\n.*{{- else }}.*\n.*image: ghcr.io\/actions\/actions-runner:([0-9]+\.[0-9]+\.[0-9]+@sha256:[a-f0-9]{64})/;
1010

src/windows-image-handler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ async function getLatestVersionOfImage() {
3939
bestMainTag = mainTag;
4040
}
4141
}
42-
return [`electronarc.azurecr.io/win-actions-runner:${bestMainTag}@${best.name}`, bestMainTag];
42+
return [
43+
`\${registry_name}.azurecr.io/win-actions-runner:${bestMainTag}@${best.name}`,
44+
bestMainTag,
45+
];
4346
}
4447

4548
const WINDOWS_IMAGE_DOCKERFILE_PATH = 'docker/windows-actions-runner/Dockerfile';

tests/utils/arc-image.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
getCurrentWindowsRunnerVersion,
66
} from '../../src/utils/arc-image';
77

8-
const windowsImageContent = `electronarc.azurecr.io/win-actions-runner:main-abcdef0@sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef`;
8+
const windowsImageContent =
9+
'${registry_name}.azurecr.io/win-actions-runner:main-abcdef0@sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef';
910

1011
const linuxImageContent = `containers:
1112
- name: runner
@@ -32,7 +33,7 @@ const invalidLinuxContent = `{{- if eq .cpuArch "amd64" }}\nimage: something-els
3233
describe('arc-image utils', () => {
3334
it('should extract the current Windows image', () => {
3435
expect(currentWindowsImage(windowsImageContent)).toBe(
35-
'electronarc.azurecr.io/win-actions-runner:main-abcdef0@sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
36+
'${registry_name}.azurecr.io/win-actions-runner:main-abcdef0@sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
3637
);
3738
});
3839

0 commit comments

Comments
 (0)