Skip to content

Commit fa25e30

Browse files
committed
ci: standardize naming and validation of stdout steps
- Rename `stdout` step to `stdout01` in the GitHub Actions workflow - Rename `check stdout` step to `check stdout 01` - Update references to `stdout` to `stdout01` in echo and grep commands - Add a new step `stdout02` for SSH command execution with stdout capture - Add a new step `check stdout 02` to validate the output of `stdout02` step Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 903686e commit fa25e30

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ jobs:
622622
echo "======================================"
623623
sleep 2
624624
625-
- id: stdout
626-
name: ssh command with stdout
625+
- id: stdout01
626+
name: ssh command with stdout 01
627627
uses: ./
628628
with:
629629
host: ${{ env.REMOTE_HOST }}
@@ -641,13 +641,43 @@ jobs:
641641
echo "False"
642642
fi
643643
644-
- name: check stdout
644+
- name: check stdout 01
645645
run: |
646-
echo "stdout: ${{ steps.stdout.outputs.stdout }}"
647-
if echo "${{ steps.stdout.outputs.stdout }}" | grep -q "True"; then
646+
echo "stdout: ${{ steps.stdout01.outputs.stdout }}"
647+
if echo "${{ steps.stdout01.outputs.stdout }}" | grep -q "True"; then
648648
echo "Output contains 'True'"
649649
exit 1
650650
fi
651-
if echo "${{ steps.stdout.outputs.stdout }}" | grep -q "False"; then
651+
if echo "${{ steps.stdout01.outputs.stdout }}" | grep -q "False"; then
652652
echo "Output contains 'False'"
653653
fi
654+
655+
- id: stdout02
656+
name: ssh command with stdout 01
657+
uses: ./
658+
with:
659+
host: ${{ env.REMOTE_HOST }}
660+
username: linuxserver.io
661+
password: password
662+
port: 2222
663+
capture_stdout: true
664+
script: |
665+
#!/usr/bin/env bash
666+
set -e
667+
echo "TMP TESTING IF"
668+
if [[ "1" == "1" ]]; then
669+
echo "True"
670+
else
671+
echo "False"
672+
fi
673+
674+
- name: check stdout 02
675+
run: |
676+
echo "stdout: ${{ steps.stdout02.outputs.stdout }}"
677+
if echo "${{ steps.stdout02.outputs.stdout }}" | grep -q "False"; then
678+
echo "Output contains 'False'"
679+
exit 1
680+
fi
681+
if echo "${{ steps.stdout02.outputs.stdout }}" | grep -q "True"; then
682+
echo "Output contains 'True'"
683+
fi

0 commit comments

Comments
 (0)