-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Replace set-output
command
#1986
Changes from all commits
00c5b9e
8d522c3
0ec4e4c
ede755b
9a01349
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -822,7 +822,7 @@ def display_header(): | |||||||||
logging.info("") | ||||||||||
|
||||||||||
def check_results(self): | ||||||||||
print(f"::set-output name=has_updated_sources::{str(self.has_updated_sources)}") | ||||||||||
print(f'"has_updated_sources={str(self.has_updated_sources)}" >>"$GITHUB_OUTPUT"') | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could work, but it will update $GITHUB_OUTPUT within MegaLinter docker image There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the existing code looks correct, just deprecated. The goal here is simply to append to the file named from os import environ
output_file = environ["GITHUB_OUTPUT"]
with open(output_file, "a", encoding="utf-8") as output_stream:
output_stream.write(f"has_updated_sources={str(self.has_updated_sources)}\n") There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Kurt-von-Laven print(), not output_stream.write() ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last line could be replaced with: output_stream.write(f"has_updated_sources={str(self.has_updated_sources)}\n") Any preference? Just saw your previous message. To be clear, we don’t want to overwrite the environment variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer the write option , it's more readable that a print that we expect more to be just a line in the console :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parkerbxyz maybe u'd like to ressuscitate your PR and update it ? :) ( ps: just been rickrolled... 😠 🤣 ) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me. I updated the code snippet accordingly. Ha ha, the meme that will never die. |
||||||||||
if self.status == "success": | ||||||||||
logging.info(c.green("✅ Successfully linted all files without errors")) | ||||||||||
config.delete() | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Bash changes look correct at a glance, but I suspect printing Bash syntax from Python has no special effect. See EnricoMi/publish-unit-test-result-action#360 for an example of the correct syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid you're right... I'll rollback the PR to not break behaviour until we have a working solution ( cc @parkerbxyz )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, is it working as expected without my changes?
How about something like this?