Skip to content

Commit d99fe30

Browse files
committed
Mask the endpoint
1 parent cf2b4e0 commit d99fe30

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

action-runner/dist/index.js

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

action-runner/src/main.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ let workspace: string;
1717
let currentCommand: Promise<ExecOutput> | null = null;
1818

1919
export async function run() {
20-
let githubWorkspacePath = process.env['GITHUB_WORKSPACE']
20+
const githubWorkspacePath = process.env['GITHUB_WORKSPACE']
2121
if (!githubWorkspacePath) {
2222
throw new Error('GITHUB_WORKSPACE not defined')
2323
}
2424
workspace = path.resolve(githubWorkspacePath)
2525

26-
await setupWs(
27-
core.getInput("endpoint"),
28-
onMessage
29-
);
26+
const endpoint = core.getInput("endpoint")
27+
core.setSecret(endpoint)
28+
await setupWs(endpoint, onMessage)
3029
}
3130

3231
export async function onMessage(ws: WebSocket, msg: any) {
@@ -36,13 +35,13 @@ export async function onMessage(ws: WebSocket, msg: any) {
3635
ws.send(JSON.stringify({
3736
repository: process.env['GITHUB_REPOSITORY'],
3837
id: parseInt(process.env['GITHUB_RUN_ID']!),
39-
token: process.env['GITHUB_TOKEN']!!,
38+
token: process.env['GITHUB_TOKEN'],
4039
userHome: await determineUserHome()
4140
}))
4241
} else if (json.type == "command") {
4342
const command: string[] = json.command
4443

45-
console.error(`Executing "${command.join(' ')}"\n`)
44+
core.startGroup(`Executing "${command.join(' ')}"`)
4645

4746
let cmdLine = command.shift()!
4847
const optional = cmdLine.startsWith("?")
@@ -55,6 +54,8 @@ export async function onMessage(ws: WebSocket, msg: any) {
5554
ignoreReturnCode: true
5655
})
5756
.then(executed => {
57+
core.endGroup()
58+
console.log(`Command returned exit code ${executed.exitCode}`)
5859
if (!optional && executed.exitCode != 0) {
5960
ws.send(JSON.stringify({
6061
stderr: executed.stderr
@@ -64,8 +65,6 @@ export async function onMessage(ws: WebSocket, msg: any) {
6465
stdout: executed.stdout
6566
}))
6667
}
67-
68-
console.log(`\nCommand returned exit code ${executed.exitCode}`)
6968
return executed
7069
}).finally(() => {
7170
currentCommand = null

0 commit comments

Comments
 (0)