-
-
Notifications
You must be signed in to change notification settings - Fork 587
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
feat: capture stdout and store as output #287
Conversation
One potential issue is that secrets aren't masked in the output variable like they are in the log. I was able to fix it with a filtering step, but it's manual: - uses: mad9000/actions-find-and-replace-string@4
id: filter
with:
source: ${{ steps.ssh.outputs.stdout }}
find: '${{ secrets.value }}'
replace: '***'
replaceAll: true
- run: echo '${{ steps.filter.outputs.value }}' |
edit: fixed conflicts |
@appleboy |
I'd add a variable to enable (or disable) this behavior, as sometimes the outputs could be huge |
Good point, it should probably also not capture by default because the output has all command output (without censoring, like the gh step interface has) |
I think the script should handle masking secrets by itself , not very good practice to depend on another step for doing it , this can cause security issues if some one forget it |
I agree! Is there a way to get secret names at runtime? I was under the impression that github action output is filtered before displaying, but doesn't have any filtering on the server side |
@GammaGames or @appleboy is there any update on when this would be merged in? |
@mikesalvia I don't know, but I should probably make it optional and disabled by default first. I started working on that a little today but have yet to test it: https://github.com/GammaGames/ssh-action/tree/capture_vars |
Okay it's optional now. Idk why it's not showing in the github action, it's working fine on nektos act and gitea: https://github.com/GammaGames/ssh-action/actions/runs/12017938366/job/33504424638 edit: started discussion asking for help - https://github.com/orgs/community/discussions/145592 |
I will take it. |
@GammaGames Please help to resolve the conflicts. |
Fixed, also changed the test to use Why remove the |
@GammaGames Thanks.
The script_stop function detects each line of instruction, but it cannot handle line breaks using the backslash (). Therefore, I will write another method to solve this problem. |
Thank you @GammaGames and all who assisted! |
Possibly fixes #274, #38
If successful, it has the following in
steps.ssh.outputs.stdout
:On error it acts like it does now.