GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor: streamline output handling for GITHUB_OUTPUT in workflows by appleboy · Pull Request #404 · appleboy/ssh-action

Conversation

@appleboy

@appleboy appleboy commented Jan 28, 2026

Copy link
Copy Markdown
Owner
  • Write the stdout<<EOF and EOF markers directly to GITHUB_OUTPUT instead of using a group command
  • Simplify the process for capturing and appending command output to GITHUB_OUTPUT
  • Add a check to ensure captured stdout is not empty
  • Add steps to capture and verify multiline stdout output
  • Add verification that specific lines and the username are present in captured output
  • Add steps to handle and verify stdout containing special characters and file paths

fix #403
fix #397

Signed-off-by: appleboy [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
appleboy added 2 commits January 28, 2026 09:30
@appleboy
refactor: streamline output handling for GITHUB_OUTPUT in workflows
fd269aa
- Write the stdout<<EOF and EOF markers directly to GITHUB_OUTPUT instead of using a group command
- Simplify the process for capturing and appending command output to GITHUB_OUTPUT

fix #403
fix #397

Signed-off-by: appleboy <[email protected]>
@appleboy
test: enhance stdout capture and verification in tests
328b174
- Add a check to ensure captured stdout is not empty
- Add steps to capture and verify multiline stdout output
- Add verification that specific lines and the username are present in captured output
- Add steps to handle and verify stdout containing special characters and file paths

Signed-off-by: appleboy <[email protected]>
Copilot AI review requested due to automatic review settings January 28, 2026 01:35
Copilot started reviewing on behalf of appleboy January 28, 2026 01:35
View session
Copilot AI reviewed Jan 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

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.

Pull request overview

This PR fixes a critical bug where stdout was being duplicated when capture_stdout: true was enabled. The issue was introduced in a previous refactoring that wrapped the output capture logic in a subshell, causing the output to be written twice to GITHUB_OUTPUT.

Changes:

  • Removed the subshell wrapper in entrypoint.sh that was causing output duplication
  • Added comprehensive tests to verify stdout capture works correctly with empty checks, multiline output, and special characters

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
entrypoint.sh Simplified stdout capture by removing the problematic subshell and writing delimiters directly to GITHUB_OUTPUT
.github/workflows/main.yml Added three new test cases to validate stdout capture functionality: empty output check, multiline output verification, and special characters handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/main.yml
Comment on lines +672 to +682
- name: check special characters output
run: |
echo "stdout: ${{ steps.stdout-with-special-chars.outputs.stdout }}"
if ! echo "${{ steps.stdout-with-special-chars.outputs.stdout }}" | grep -q "special chars"; then
echo "Error: special characters test failed"
exit 1
fi
if ! echo "${{ steps.stdout-with-special-chars.outputs.stdout }}" | grep -q "/home/user/test"; then
echo "Error: path not found in output"
exit 1
fi

Copilot AI Jan 28, 2026

Copy link

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 test verifies special characters and file paths but doesn't verify the JSON output line. Consider adding a check to ensure the JSON line with escaped quotes is captured correctly, as this is an important edge case for validating special character handling.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/main.yml
Comment on lines +635 to +654
- name: check multiline output
run: |
echo "stdout: ${{ steps.stdout-multiline.outputs.stdout }}"
# Check if all lines are present
if ! echo "${{ steps.stdout-multiline.outputs.stdout }}" | grep -q "Line 1"; then
echo "Error: 'Line 1' not found in output"
exit 1
fi
if ! echo "${{ steps.stdout-multiline.outputs.stdout }}" | grep -q "Line 2"; then
echo "Error: 'Line 2' not found in output"
exit 1
fi
if ! echo "${{ steps.stdout-multiline.outputs.stdout }}" | grep -q "Line 3"; then
echo "Error: 'Line 3' not found in output"
exit 1
fi
if ! echo "${{ steps.stdout-multiline.outputs.stdout }}" | grep -q "linuxserver.io"; then
echo "Error: username not found in output"
exit 1
fi

Copilot AI Jan 28, 2026

Copy link

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.

Consider adding a test that explicitly verifies the output is not duplicated. Since this PR fixes issue #397 about duplicated output, it would be valuable to have a test that counts the occurrences of specific output lines to ensure they appear exactly once, not twice. For example, you could check that "Line 1" appears exactly once in the multiline output test.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot uses AI. Check for mistakes.
@appleboy
ci: enforce unique occurrence of lines in multiline output validation
353036a
- Add a step to verify that lines "Line 1", "Line 2", and "Line 3" each appear exactly once in the multiline output
- Fail the workflow if any line is missing or duplicated
- Confirm successful validation with a message when no duplicates are found

Signed-off-by: appleboy <[email protected]>
@appleboy
appleboy merged commit 0ff4204 into master Jan 28, 2026
28 of 30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@appleboy
appleboy deleted the github branch January 28, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Duplicated output capture on the latest (1.2.3) version.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@appleboy
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.