Tested the 2> /dev/null stderr shell redirection using GitHub Actions windows-latest workflow with shell: bash (Git Bash, which is based on MSYS2 Bash)
name: Temp Windows Bash Testing
on: push
jobs:
temp-windows-bash-testing:
name: Temp Windows Bash Testing
runs-on: windows-latest
timeout-minutes: 5
steps:
- name: Test command in Windows Bash
shell: bash
run: |
where bash
echo $SHELL
uname -a
cat /proc/version
rm next.config.mjs next.config.ts 2> /dev/null || true
echo 'after 1st rm'
Output:
C:\Program Files\Git\usr\bin\bash.exe
C:\Program Files\Git\bin\bash.exe
C:\Windows\System32\bash.exe
/usr/bin/bash
MINGW64_NT-10.0-20348 fv-az521-331 3.4.10-2e2ef940.x86_64 2024-07-09 21:35 UTC x86_64 Msys
MINGW64_NT-10.0-20348 version 3.4.10-2e2ef940.x86_64 (@fv-az1785-729) (gcc version 13.3.0 (GCC) ) 2024-07-09 21:35 UTC
after 1st rm
I needed to add || true on GitHub Actions to avoid the exit code 1 from rm causing the step to fail, but the exit code won't be an issue on student systems, because the rm command will be entered interactively (will not be a part of a script).
Result:
Tested the
2> /dev/null
stderr shell redirection using GitHub Actionswindows-latest
workflow withshell: bash
(Git Bash, which is based on MSYS2 Bash)Output:
I needed to add
|| true
on GitHub Actions to avoid the exit code 1 fromrm
causing the step to fail, but the exit code won't be an issue on student systems, because therm
command will be entered interactively (will not be a part of a script).