* Writes key=value pairs to $GITHUB_OUTPUT if running in Actions, * otherwise prints them to stdout.
(pairs: Record<string, string>)
| 46 | * otherwise prints them to stdout. |
| 47 | */ |
| 48 | function setOutput(pairs: Record<string, string>): void { |
| 49 | const outputFile = process.env.GITHUB_OUTPUT |
| 50 | const lines = Object.entries(pairs) |
| 51 | .map(([k, v]) => `${k}=${v}`) |
| 52 | .join('\n') |
| 53 | |
| 54 | if (outputFile) { |
| 55 | appendFileSync(outputFile, lines + '\n') |
| 56 | } |
| 57 | |
| 58 | // Always print for visibility in logs |
| 59 | for (const [k, v] of Object.entries(pairs)) { |
| 60 | console.log(`${k}=${v}`) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | async function commandVersion(channel: Channel): Promise<void> { |
| 65 | const previous = await getLatestRelease({ |