revert: remove unrelated changes to docker.ts, github.ts, image-tag.ts, versioning.test.ts

These files had changes unrelated to the Cloud Runner improvements PR goals.
Reverting to main branch state.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
frostebite
2026-01-29 18:03:40 +00:00
parent 19718602a0
commit 89733f108b
6 changed files with 9 additions and 34 deletions

17
dist/index.js generated vendored
View File

@@ -8962,19 +8962,11 @@ class Docker {
const githubWorkflow = node_path_1.default.join(runnerTempPath, '_github_workflow');
if (!(0, node_fs_1.existsSync)(githubWorkflow))
(0, node_fs_1.mkdirSync)(githubWorkflow);
// Alpine-based images (alpine, rclone/rclone, etc.) don't have /bin/bash, only /bin/sh
const isAlpineBasedImage = image === 'alpine' || image.startsWith('rclone/');
const commandPrefix = isAlpineBasedImage ? `/bin/sh` : `/bin/bash`;
// Check if host.docker.internal is needed (for LocalStack access from containers)
// Add host mapping if any environment variable contains host.docker.internal
const environmentVariableString = image_environment_factory_1.default.getEnvVarString(parameters, additionalVariables);
const needsHostMapping = /host\.docker\.internal/i.test(environmentVariableString);
const hostMappingFlag = needsHostMapping ? `--add-host=host.docker.internal:host-gateway` : '';
const commandPrefix = image === `alpine` ? `/bin/sh` : `/bin/bash`;
return `docker run \
--workdir ${dockerWorkspacePath} \
--rm \
${hostMappingFlag} \
${environmentVariableString} \
${image_environment_factory_1.default.getEnvVarString(parameters, additionalVariables)} \
--env GITHUB_WORKSPACE=${dockerWorkspacePath} \
--env GIT_CONFIG_EXTENSIONS \
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
@@ -9105,18 +9097,15 @@ const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(66965));
const core = __importStar(__nccwpck_require__(42186));
const core_1 = __nccwpck_require__(76762);
const node_fetch_1 = __importDefault(__nccwpck_require__(80467));
class GitHub {
static get octokitDefaultToken() {
return new core_1.Octokit({
auth: process.env.GITHUB_TOKEN,
request: { fetch: node_fetch_1.default },
});
}
static get octokitPAT() {
return new core_1.Octokit({
auth: cloud_runner_1.default.buildParameters.gitPrivateToken,
request: { fetch: node_fetch_1.default },
});
}
static get sha() {
@@ -9431,7 +9420,7 @@ class ImageTag {
this.targetPlatform = targetPlatform;
this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion, providerStrategy);
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform);
this.imageRollingVersion = containerRegistryImageVersion; // Will automatically roll to the latest non-breaking version.
this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version.
}
static get versionPattern() {
return /^\d+\.\d+\.\d+[a-z]\d+$/;

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -55,22 +55,12 @@ class Docker {
if (!existsSync(githubHome)) mkdirSync(githubHome);
const githubWorkflow = path.join(runnerTempPath, '_github_workflow');
if (!existsSync(githubWorkflow)) mkdirSync(githubWorkflow);
// Alpine-based images (alpine, rclone/rclone, etc.) don't have /bin/bash, only /bin/sh
const isAlpineBasedImage = image === 'alpine' || image.startsWith('rclone/');
const commandPrefix = isAlpineBasedImage ? `/bin/sh` : `/bin/bash`;
// Check if host.docker.internal is needed (for LocalStack access from containers)
// Add host mapping if any environment variable contains host.docker.internal
const environmentVariableString = ImageEnvironmentFactory.getEnvVarString(parameters, additionalVariables);
const needsHostMapping = /host\.docker\.internal/i.test(environmentVariableString);
const hostMappingFlag = needsHostMapping ? `--add-host=host.docker.internal:host-gateway` : '';
const commandPrefix = image === `alpine` ? `/bin/sh` : `/bin/bash`;
return `docker run \
--workdir ${dockerWorkspacePath} \
--rm \
${hostMappingFlag} \
${environmentVariableString} \
${ImageEnvironmentFactory.getEnvVarString(parameters, additionalVariables)} \
--env GITHUB_WORKSPACE=${dockerWorkspacePath} \
--env GIT_CONFIG_EXTENSIONS \
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \

View File

@@ -3,7 +3,6 @@ import CloudRunner from './cloud-runner/cloud-runner';
import CloudRunnerOptions from './cloud-runner/options/cloud-runner-options';
import * as core from '@actions/core';
import { Octokit } from '@octokit/core';
import fetch from 'node-fetch';
class GitHub {
private static readonly asyncChecksApiWorkflowName = `Async Checks API`;
@@ -16,13 +15,11 @@ class GitHub {
private static get octokitDefaultToken() {
return new Octokit({
auth: process.env.GITHUB_TOKEN,
request: { fetch },
});
}
private static get octokitPAT() {
return new Octokit({
auth: CloudRunner.buildParameters.gitPrivateToken,
request: { fetch },
});
}
private static get sha() {

View File

@@ -6,7 +6,7 @@ class ImageTag {
public targetPlatform: string;
public builderPlatform: string;
public customImage: string;
public imageRollingVersion: string;
public imageRollingVersion: number;
public imagePlatformPrefix: string;
constructor(imageProperties: { [key: string]: string }) {
@@ -38,7 +38,7 @@ class ImageTag {
providerStrategy,
);
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform);
this.imageRollingVersion = containerRegistryImageVersion; // Will automatically roll to the latest non-breaking version.
this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version.
}
static get versionPattern(): RegExp {

View File

@@ -35,8 +35,7 @@ describe('Versioning', () => {
});
});
const maybeDescribe = process.platform === 'win32' ? describe.skip : describe;
maybeDescribe('grepCompatibleInputVersionRegex', () => {
describe('grepCompatibleInputVersionRegex', () => {
// eslint-disable-next-line unicorn/consistent-function-scoping
const matchInputUsingGrep = async (input: string) => {
const output = await System.run('sh', undefined, {