Skip to content

Commit 1864729

Browse files
committed
feat: trying to write directly to process.env.GITHUB_OUTPUT in typescript file
1 parent fddfada commit 1864729

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

dist/index.js

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

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import * as core from '@actions/core'
22
import { wait } from './wait'
3+
import { stdout } from 'process'
4+
import * as fs from 'fs'
35

46
/**
57
* The main function for the action.
@@ -20,7 +22,11 @@ export async function run(): Promise<void> {
2022
// Set outputs for other workflow steps to use
2123
core.setOutput('time', new Date().toTimeString())
2224

23-
console.log(`
25+
// print to stdout
26+
27+
stdout.write('This is a single-line string\n')
28+
29+
const result = `
2430
This is a multi-line string
2531
2632
# API Differences
@@ -35,7 +41,11 @@ export async function run(): Promise<void> {
3541
3642
## DELETED
3743
---
38-
`)
44+
`
45+
46+
console.log(result)
47+
48+
fs.writeFileSync(process.env.GITHUB_OUTPUT!, `${'test-action'}=${result}`)
3949
} catch (error) {
4050
// Fail the workflow run if an error occurs
4151
if (error instanceof Error) core.setFailed(error.message)

0 commit comments

Comments
 (0)