-
Notifications
You must be signed in to change notification settings - Fork 255
missing end-of-line character when writing to $GITHUB_OUTPUT #884
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
Comments
@jcarnis, thank you for the issue and fix action. If you have time to build a PR that would be great, otherwise I will try to get to it this weekend. |
codejedi365
added a commit
to codejedi365/python-semantic-release
that referenced
this issue
Apr 6, 2024
tests were adjusted for clarity and to replicate error detailed in python-semantic-release#884.
codejedi365
added a commit
to codejedi365/python-semantic-release
that referenced
this issue
Apr 6, 2024
codejedi365
added a commit
to codejedi365/python-semantic-release
that referenced
this issue
Apr 6, 2024
tests were adjusted for clarity and to replicate error detailed in python-semantic-release#884.
codejedi365
added a commit
to codejedi365/python-semantic-release
that referenced
this issue
Apr 6, 2024
🎉 This issue has been resolved in version 9.4.1 🎉The release is available on: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem
VersionGitHubActionsOutput.write_if_possible is writing to $GITHUB_OUTPUT, but fails to add an end-of line afterwards.
If one tries to echo another variable to $GITHUB_OUTPUT, it is then added to the previous line instead of a new line, and can't be used later in the workflow.
Here are the command from the workflow:

And the printed output:

Adding
echo "" >> $GITHUB_OUTPUT
before the next echo to $GITHUB_OUTPUT solved the issue as a workaround.Expected behavior
Semantic release should write properly to $GITHUB_OUTPUT, finding out where the issue lies is time-consuming since this happens in the background.
Returning
"\n".join(f"{key}={value!s}" for key, value in outputs.items()) + "\n"
in VersionGitHubActionsOutput.to_output_text solves the issue.Context
Linux runner
semantic release v9.3.1
Looking at the latest version, the issue seems still present.
The text was updated successfully, but these errors were encountered: