Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$GITHUB_STEP_SUMMARY is undefined #1647

Closed
joanrodriguez opened this issue Feb 23, 2023 · 4 comments
Closed

$GITHUB_STEP_SUMMARY is undefined #1647

joanrodriguez opened this issue Feb 23, 2023 · 4 comments
Labels
kind/bug Something isn't working

Comments

@joanrodriguez
Copy link

Bug report info

n/a

Command used with act

act

Describe issue

When running act, my workflows fail if they try to write to GITHUB_STEP_SUMMARY.

I found as a workaround that I can make my workflows work by providing a value through the --env flag:

I searched the code and the only mention of this ENV variable is this line:

if(process.env.GITHUB_STEP_SUMMARY) {
core.summary.addCodeBlock(myOutput);
await core.summary.write();
}

Since it's wrapped around an if statement, I'm assuming that it cannot fail.

Not familiar with the code and not a Go developer, but I'm assuming it should be defined there?

act/pkg/runner/step.go

Lines 108 to 111 in 21ea3d0

(*step.getEnv())["GITHUB_OUTPUT"] = path.Join(actPath, outputFileCommand)
(*step.getEnv())["GITHUB_STATE"] = path.Join(actPath, stateFileCommand)
(*step.getEnv())["GITHUB_PATH"] = path.Join(actPath, pathFileCommand)
(*step.getEnv())["GITHUB_ENV"] = path.Join(actPath, envFileCommand)

Thanks

Link to GitHub repository

No response

Workflow content

const summaryFilePath = process.env['GITHUB_STEP_SUMMARY'];
await promises.appendFile(summaryFilePath, report, {encoding: 'utf8'});

Relevant log output

| TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
|     at open (node:internal/fs/promises:456:10)
|     at writeFile (node:internal/fs/promises:795:20)
|     at Object.appendFile (node:internal/fs/promises:808:10)
|     at file:///root/dev/realadvisor/[eval1]:36:18
|     at processTicksAndRejection


### Additional information

_No response_
@joanrodriguez joanrodriguez added the kind/bug Something isn't working label Feb 23, 2023
@joanrodriguez
Copy link
Author

Sorry, just found out about #1607 and #1533

@catthehacker
Copy link
Member

Fixed via #1607

@joanrodriguez
Copy link
Author

Thanks!!

When's the next release?

@jsoref
Copy link
Contributor

jsoref commented Apr 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants