Skip to content

Commit

Permalink
Merge pull request #1 from fractiunate-circle/fractiunate-patch-1
Browse files Browse the repository at this point in the history
Update utils.ts with set-output work-arround
  • Loading branch information
fractiunate authored Jul 6, 2023
2 parents 00dba38 + 13e2583 commit 3ab0c45
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as core from '@actions/core'
import * as github from '@actions/github'
const os = require("os")
const fs = require("fs")

enum TimeUnit {
S = 1000,
Expand Down Expand Up @@ -74,6 +76,12 @@ export function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}

export function setOutput(key, value) {
// Temporary hack until core actions library catches up with github new recommendations
const output = process.env['GITHUB_OUTPUT']
fs.appendFileSync(output, `${key}=${value}${os.EOL}`)
}

export function isTimedOut(start: number, waitForCompletionTimeout: number) {
return Date.now() > start + waitForCompletionTimeout;
}
Expand Down

0 comments on commit 3ab0c45

Please sign in to comment.