Skip to content

Commit 4571118

Browse files
committed
Add command to set env var
1 parent 42d68d8 commit 4571118

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

action-runner/dist/index.js

Lines changed: 6 additions & 0 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export async function onMessage(ws: WebSocket, msg: any) {
7070
currentCommand = null
7171
})
7272

73+
} else if (json.type == "set-env") {
74+
const name: string = json.name
75+
const value: string = json.value
76+
await exec.getExecOutput("echo", [name + "=" + value, ">>", process.env.GITHUB_ENV!])
77+
ws.send("{}")
7378
} else if (json.type == "write-file") {
7479
const pth = path.resolve(workspace, json.path)
7580
await fs.mkdir(path.dirname(pth), {

0 commit comments

Comments
 (0)