Skip to content

build: roll github actions runners automatically #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jkleinsc
Copy link
Member

@jkleinsc jkleinsc commented Jun 6, 2025

This PR adds roll capability to our github actions runner images. If a new version is available at https://github.com/actions/runner/pkgs/container/actions-runner, create a PR updating the infra repo with the new runner version.

@jkleinsc jkleinsc requested review from a team as code owners June 6, 2025 17:26
@jkleinsc jkleinsc force-pushed the roll-actions-runner branch from 704ccca to b786180 Compare June 6, 2025 17:27
@@ -1,12 +1,12 @@
import { Octokit } from '@octokit/rest';
import { MAIN_BRANCH, REPOS } from '../constants';
import { MAIN_BRANCH, REPOS, WINDOWS_DOCKER_FILE } from '../constants';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { MAIN_BRANCH, REPOS, WINDOWS_DOCKER_FILE } from '../constants';
import { MAIN_BRANCH, REPOS } from '../constants';

Looks unused in this file.

Comment on lines +27 to +45
export const currentLinuxImages = (content: string) => {
const matches = content.match(LINUX_IMAGE_REGEX);
if (!matches || matches.length < 3) {
return {
amd64: '',
arm64: '',
};
} else {
return {
amd64: matches[1],
arm64: matches[2],
};
}
};

export async function getCurrentWindowsRunnerVersion(content: string) {
return content.match(WINDOWS_RUNNER_REGEX)?.[1];
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage for these two utils would be nice, reviewing raw regexes never feels very effective. 😀

Comment on lines +32 to +53
// Helper to fetch JSON from a URL
function fetchJson(url: string, headers: Record<string, string> = {}): Promise<any> {
return new Promise((resolve, reject) => {
https
.get(url, { headers }, (res) => {
let data = '';
res.on('data', (chunk) => (data += chunk));
res.on('end', () => {
if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
try {
resolve(JSON.parse(data));
} catch (e) {
reject(e);
}
} else {
reject(new Error(`HTTP ${res.statusCode}: ${data}`));
}
});
})
.on('error', reject);
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we can't just use const resp = fetch(...); if (resp.ok) resp.json(); instead of rolling it ourselves?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants