mirror of
https://github.com/github/codeql-action.git
synced 2026-08-06 13:13:45 -05:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b5b1699bc0 | |||
| e977f57489 | |||
| e42f82ead7 | |||
| 259a837405 | |||
| 9a2a2da304 | |||
| d39a4f6fac | |||
| 0eee1e99c7 | |||
| 006bb00765 | |||
| d6f6ef4b0b |
@@ -7,7 +7,7 @@ if [ ! -z "$(git status --porcelain)" ]; then
|
||||
>&2 echo "Failed: Repo should be clean before testing!"
|
||||
exit 1
|
||||
fi
|
||||
sudo npm install --force -g npm@latest
|
||||
sudo npm install --force -g npm@8.19.2
|
||||
# Reinstall modules and then clean to remove absolute paths
|
||||
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
|
||||
npm ci
|
||||
@@ -15,7 +15,7 @@ npm run removeNPMAbsolutePaths
|
||||
# Check that repo is still clean
|
||||
if [ ! -z "$(git status --porcelain)" ]; then
|
||||
# If we get a fail here then the PR needs attention
|
||||
>&2 echo "Failed: node_modules are not up to date. Run 'npm ci && npm run removeNPMAbsolutePaths' on a macOS machine to update. Note it is important this command is run on macOS and not any other operating system as there is one dependency (fsevents) that is needed for macOS and may not be installed if the command is run on a Windows or Linux machine."
|
||||
>&2 echo "Failed: node_modules are not up to date. Run 'npm ci && npm run removeNPMAbsolutePaths' on a macOS machine to update and commit. Note it is important this command is run on macOS and not any other operating system as there is one dependency (fsevents) that is needed for macOS and may not be installed if the command is run on a Windows or Linux machine. If there are no changes, run 'npm install --force -g npm@8.19.2' with root permissions first."
|
||||
git status
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Generated
-9
@@ -74,14 +74,6 @@ async function sendSuccessStatusReport(startedAt, config, toolsVersion, logger)
|
||||
async function run() {
|
||||
const startedAt = new Date();
|
||||
const logger = (0, logging_1.getActionsLogger)();
|
||||
const longTask = new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 999999999);
|
||||
});
|
||||
await (0, util_1.withTimeout)(10, longTask, () => {
|
||||
logger.info("Long task timed out");
|
||||
});
|
||||
(0, util_1.initializeEnvironment)(util_1.Mode.actions, pkg.version);
|
||||
await (0, util_1.checkActionVersion)(pkg.version);
|
||||
let config;
|
||||
@@ -185,7 +177,6 @@ async function runWrapper() {
|
||||
core.setFailed(`init action failed: ${error}`);
|
||||
console.log(error);
|
||||
}
|
||||
await (0, util_1.checkForTimeout)();
|
||||
}
|
||||
void runWrapper();
|
||||
//# sourceMappingURL=init-action.js.map
|
||||
File diff suppressed because one or more lines are too long
Generated
-8
@@ -71,14 +71,6 @@ exports.getTrapCachingExtractorConfigArgsForLang = getTrapCachingExtractorConfig
|
||||
*/
|
||||
async function downloadTrapCaches(codeql, languages, logger) {
|
||||
var _a, _b;
|
||||
const longTask = new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 999999999);
|
||||
});
|
||||
await (0, util_1.withTimeout)(10, longTask, () => {
|
||||
logger.info("Long task timed out");
|
||||
});
|
||||
const result = {};
|
||||
const languagesSupportingCaching = await getLanguagesSupportingCaching(codeql, languages, logger);
|
||||
logger.info(`Found ${languagesSupportingCaching.length} languages that support TRAP caching`);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Generated
+3
-2
@@ -733,7 +733,8 @@ let hadTimeout = false;
|
||||
* original promise hangs, then this will prevent the process terminating.
|
||||
* If a timeout has occurred then the global hadTimeout variable will get set
|
||||
* to true, and the caller is responsible for forcing the process to exit
|
||||
* if this is the case by calling the `checkForTimeout` function.
|
||||
* if this is the case by calling the `checkForTimeout` function at the end
|
||||
* of execution.
|
||||
*
|
||||
* @param timeoutMs The timeout in milliseconds.
|
||||
* @param promise The promise to run.
|
||||
@@ -753,7 +754,7 @@ async function withTimeout(timeoutMs, promise, onTimeout) {
|
||||
// Workaround: While the promise racing below will allow the main code
|
||||
// to continue, the process won't normally exit until the asynchronous
|
||||
// task in the background has finished. We set this variable to force
|
||||
// an exit at the end of our code.
|
||||
// an exit at the end of our code when `checkForTimeout` is called.
|
||||
hadTimeout = true;
|
||||
onTimeout();
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -29,7 +29,6 @@ import { parseRepositoryNwo } from "./repository";
|
||||
import { getTotalCacheSize } from "./trap-caching";
|
||||
import {
|
||||
checkActionVersion,
|
||||
checkForTimeout,
|
||||
checkGitHubVersionInRange,
|
||||
codeQlVersionAbove,
|
||||
DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
@@ -42,7 +41,6 @@ import {
|
||||
initializeEnvironment,
|
||||
isHostedRunner,
|
||||
Mode,
|
||||
withTimeout,
|
||||
} from "./util";
|
||||
|
||||
// eslint-disable-next-line import/no-commonjs
|
||||
@@ -139,14 +137,6 @@ async function sendSuccessStatusReport(
|
||||
async function run() {
|
||||
const startedAt = new Date();
|
||||
const logger = getActionsLogger();
|
||||
const longTask = new Promise<void>((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 999_999_999);
|
||||
});
|
||||
await withTimeout(10, longTask, () => {
|
||||
logger.info("Long task timed out");
|
||||
});
|
||||
initializeEnvironment(Mode.actions, pkg.version);
|
||||
await checkActionVersion(pkg.version);
|
||||
|
||||
@@ -349,7 +339,6 @@ async function runWrapper() {
|
||||
core.setFailed(`init action failed: ${error}`);
|
||||
console.log(error);
|
||||
}
|
||||
await checkForTimeout();
|
||||
}
|
||||
|
||||
void runWrapper();
|
||||
|
||||
@@ -68,14 +68,6 @@ export async function downloadTrapCaches(
|
||||
languages: Language[],
|
||||
logger: Logger
|
||||
): Promise<Partial<Record<Language, string>>> {
|
||||
const longTask = new Promise<void>((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 999_999_999);
|
||||
});
|
||||
await withTimeout(10, longTask, () => {
|
||||
logger.info("Long task timed out");
|
||||
});
|
||||
const result = {};
|
||||
const languagesSupportingCaching = await getLanguagesSupportingCaching(
|
||||
codeql,
|
||||
|
||||
+3
-2
@@ -872,7 +872,8 @@ let hadTimeout = false;
|
||||
* original promise hangs, then this will prevent the process terminating.
|
||||
* If a timeout has occurred then the global hadTimeout variable will get set
|
||||
* to true, and the caller is responsible for forcing the process to exit
|
||||
* if this is the case by calling the `checkForTimeout` function.
|
||||
* if this is the case by calling the `checkForTimeout` function at the end
|
||||
* of execution.
|
||||
*
|
||||
* @param timeoutMs The timeout in milliseconds.
|
||||
* @param promise The promise to run.
|
||||
@@ -896,7 +897,7 @@ export async function withTimeout<T>(
|
||||
// Workaround: While the promise racing below will allow the main code
|
||||
// to continue, the process won't normally exit until the asynchronous
|
||||
// task in the background has finished. We set this variable to force
|
||||
// an exit at the end of our code.
|
||||
// an exit at the end of our code when `checkForTimeout` is called.
|
||||
hadTimeout = true;
|
||||
onTimeout();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user