Skip to content

Commit

Permalink
feat(core): Support Windows
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Support Windows, now that CodeClimate has released a Windows binary of the reporter
  • Loading branch information
paambaati committed Apr 24, 2023
1 parent da4a6ce commit 9787ba6
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import type { ExecOptions } from '@actions/exec/lib/interfaces';

// REFER: https://docs.codeclimate.com/docs/configuring-test-coverage#locations-of-pre-built-binaries
/** Canonical download URL for the official CodeClimate reporter. */
export const DOWNLOAD_URL = `https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${platform()}-${
arch() === 'arm64' ? 'arm64' : 'amd64'
}`;
export const DOWNLOAD_URL = `https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${
platform() === 'win32' ? 'windows' : platform()
}-${arch() === 'arm64' ? 'arm64' : 'amd64'}`;
/** Local file name of the CodeClimate reporter. */
export const EXECUTABLE = './cc-reporter';
export const CODECLIMATE_GPG_PUBLIC_KEY_ID =
Expand Down Expand Up @@ -179,13 +179,6 @@ export function run(
verifyDownload: string = DEFAULT_VERIFY_DOWNLOAD
): Promise<void> {
return new Promise(async (resolve, reject) => {
if (platform() === 'win32') {
const err = new Error('CC Reporter is not supported on Windows!');
error(err.message);
setFailed('🚨 CodeClimate Reporter will not run on Windows!');
return reject(err);
}

let lastExitCode = 1;
if (workingDirectory) {
debug(`Changing working directory to ${workingDirectory}`);
Expand Down

0 comments on commit 9787ba6

Please sign in to comment.