Fix pr_comments output being empty when pr-comments input is disabled#133
Merged
shenxianpeng merged 3 commits intobugfix/fork-repo-add-commentfrom Aug 19, 2025
Conversation
…ting Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
af84ea1
into
bugfix/fork-repo-add-comment
1 of 2 checks passed
Copilot
AI
restored the
copilot/fix-8c0c2e65-6c98-4a61-a2b2-5cdfea19996c
branch
August 19, 2025 21:31
Copilot
AI
changed the title
[WIP] echo "" > pr-comments.txt why? steps.commit-check.outputs.pr_comments is empty. Help me fix it!
Fix pr_comments output being empty when pr-comments input is disabled
Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
steps.commit-check.outputs.pr_commentsoutput was empty when thepr-commentsinput was set tofalse(which is the default). This prevented users from accessing the formatted commit check results in their workflows, even when they only wanted the output data without posting actual PR comments.Root Cause
The
pr_commentsoutput was only being set inside theadd_pr_comments()function, which returns early whenPR_COMMENTS == "false". This meant the output was never written to$GITHUB_OUTPUTwhen PR comments were disabled.Solution
set_pr_comments_output()function that always sets thepr_commentsoutput regardless of thepr-commentsinput settingmain()function to callset_pr_comments_output()after all other operationsadd_pr_comments()to avoid duplication and maintain single responsibilityResult
Now
steps.commit-check.outputs.pr_commentsis always available and contains the properly formatted commit check results:This change maintains backward compatibility while fixing the missing output issue. Users can now access commit check results programmatically regardless of their PR commenting preferences.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.