Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aibaars committed Jul 24, 2024
1 parent 6186179 commit 4733419
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the

## [UNRELEASED]

No user facing changes.
- Experimental: add a new `start-proxy` action which starts the same HTTP proxy as used by [`github/dependabot-action`](https://github.com/github/dependabot-action). Do not use this in production as it is part of an internal experiment and subject to change at any time.

## 3.25.11 - 28 Jun 2024

Expand Down
5 changes: 4 additions & 1 deletion lib/start-proxy-action-post.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/start-proxy-action-post.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/start-proxy-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/start-proxy-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/start-proxy-action-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as fs from "fs";

import * as core from "@actions/core";

import * as actionsUtil from "./actions-util";
import * as configUtils from "./config-utils";
import { wrapError } from "./util";

async function runWrapper() {
Expand All @@ -20,7 +22,12 @@ async function runWrapper() {
`start-proxy post-action step failed: ${wrapError(error).message}`,
);
}
if (core.isDebug()) {
const config = await configUtils.getConfig(
actionsUtil.getTemporaryDirectory(),
core,
);

if ((config && config.debugMode) || core.isDebug()) {
const logFilePath = core.getState("proxy-log-file");
if (logFilePath) {
const readStream = fs.createReadStream(logFilePath);
Expand Down
3 changes: 2 additions & 1 deletion src/start-proxy-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const CERT_SUBJECT = [
},
{
name: "organizationName",
value: "GitHub ic.",
value: "GitHub inc.",
},
{
shortName: "OU",
Expand Down Expand Up @@ -130,6 +130,7 @@ async function runWrapper() {
});
subprocess.on("exit", (code) => {
if (code !== 0) {
// If the proxy failed to start, try a different port from the ephemeral range [49152, 65535]
port = Math.floor(Math.random() * (65535 - 49152) + 49152);
subprocess = undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion start-proxy/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "CodeQL: Start proxy"
description: "Start HTTP proxy server"
description: "[Experimental] Start HTTP proxy server"
author: "GitHub"
inputs:
registry_secrets:
Expand Down

0 comments on commit 4733419

Please sign in to comment.