mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-08-08 01:55:03 +02:00
fix: set sh as default shell for containers (#853)
* fix: set default shell for containers to sh This matches GitHub Actions behaviour where, runners use bash since it's guaranteed to exist there while containers use sh for compatibility * tests: fixup for default shell
This commit is contained in:
+15
-2
@@ -5,6 +5,19 @@ jobs:
|
||||
steps:
|
||||
- shell: bash
|
||||
run: |
|
||||
if [[ -n "$PATH" ]] ; then
|
||||
echo "I'm Bash!"
|
||||
if [[ -n "$BASH" ]]; then
|
||||
echo "I'm $BASH!"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
check-container:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:12-buster-slim
|
||||
steps:
|
||||
- shell: bash
|
||||
run: |
|
||||
if [[ -n "$BASH" ]]; then
|
||||
echo "I'm $BASH!"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
on: push
|
||||
jobs:
|
||||
check: # GHA uses `bash` as default for runners
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: |
|
||||
if [[ -n "$BASH" ]]; then
|
||||
echo "I'm $BASH!"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
check-container: # GHA uses `sh` as default for containers
|
||||
runs-on: ubuntu-latest
|
||||
container: alpine:latest
|
||||
steps:
|
||||
- run: |
|
||||
if [ -z ${BASH+x} ]; then
|
||||
echo "I'm sh!"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
+7
@@ -6,3 +6,10 @@ jobs:
|
||||
- shell: pwsh
|
||||
run: |
|
||||
$PSVersionTable
|
||||
check-container:
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/justingrote/act-pwsh:latest
|
||||
steps:
|
||||
- shell: pwsh
|
||||
run: |
|
||||
$PSVersionTable
|
||||
|
||||
+8
@@ -7,3 +7,11 @@ jobs:
|
||||
run: |
|
||||
import platform
|
||||
print(platform.python_version())
|
||||
check-container:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:12-buster
|
||||
steps:
|
||||
- shell: python
|
||||
run: |
|
||||
import platform
|
||||
print(platform.python_version())
|
||||
|
||||
+14
-1
@@ -5,6 +5,19 @@ jobs:
|
||||
steps:
|
||||
- shell: sh
|
||||
run: |
|
||||
if [ -n "$PATH" ] ; then
|
||||
if [ -z ${BASH+x} ]; then
|
||||
echo "I'm sh!"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
check-container:
|
||||
runs-on: ubuntu-latest
|
||||
container: alpine:latest
|
||||
steps:
|
||||
- shell: sh
|
||||
run: |
|
||||
if [ -z ${BASH+x} ]; then
|
||||
echo "I'm sh!"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user