mirror of
https://github.com/codecov/codecov-action
synced 2026-09-14 20:13:46 +00:00
fix: Add override OS and linux default
This commit is contained in:
+6
-15
@@ -2,15 +2,13 @@ import * as fs from 'fs';
|
||||
import * as https from 'https';
|
||||
import * as path from 'path';
|
||||
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
|
||||
import buildExec from './buildExec';
|
||||
import {
|
||||
BASEURL,
|
||||
getBaseUrl,
|
||||
getPlatform,
|
||||
getUploaderName,
|
||||
isValidPlatform,
|
||||
setFailure,
|
||||
} from './helpers';
|
||||
|
||||
@@ -19,18 +17,11 @@ import verify from './validate';
|
||||
let failCi;
|
||||
|
||||
try {
|
||||
const {execArgs, options, failCi} = buildExec();
|
||||
const platform = getPlatform();
|
||||
core.info(`==> ${platform} OS detected`);
|
||||
const {execArgs, options, failCi, os} = buildExec();
|
||||
const platform = getPlatform(os);
|
||||
|
||||
if (!isValidPlatform()) {
|
||||
setFailure(
|
||||
`Codecov: Encountered an unexpected platform: ${platform}`,
|
||||
failCi,
|
||||
);
|
||||
}
|
||||
const filename = path.join( __dirname, getUploaderName());
|
||||
https.get(BASEURL, (res) => {
|
||||
const filename = path.join( __dirname, getUploaderName(platform));
|
||||
https.get(getBaseUrl(platform), (res) => {
|
||||
// Image will be stored at this path
|
||||
const filePath = fs.createWriteStream(filename);
|
||||
res.pipe(filePath);
|
||||
@@ -43,7 +34,7 @@ try {
|
||||
}).on('finish', async () => {
|
||||
filePath.close();
|
||||
|
||||
await verify(filename);
|
||||
await verify(filename, platform);
|
||||
await fs.chmodSync(filename, '777');
|
||||
|
||||
const unlink = () => {
|
||||
|
||||
Reference in New Issue
Block a user