Support using a login shell along with the container step syntax
Describe the enhancement
Support using a login shell along with the container step syntax.
Code Snippet
# Produces an error
Action_String:
needs: Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker://ghcr.io/image
with:
args: bash -lec 'if [ "$DEMO_VAR" != "somevalue" ]; then echo "Error!"; exit 1; fi && echo "Bye!"'
# Commands seem to be ignored, no output is produced
Action_File:
needs: Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cat > symbiflow-examples-tests.sh <<'EOF'
if [ "$DEMO_VAR" != "somevalue" ]; then echo "Error!"; exit 1; fi
echo "Bye!"
EOF
- uses: docker://ghcr.io/image
with:
args: bash -le ./symbiflow-examples-tests.sh
# Commands seem to be ignored, no output is produced
Action_Shebang:
needs: Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cat > symbiflow-examples-tests.sh <<'EOF'
#!/usr/bin/env -S bash -le
if [ "$DEMO_VAR" != "somevalue" ]; then echo "Error!"; exit 1; fi
echo "Bye!"
EOF
chmod +x symbiflow-examples-tests.sh
- uses: docker://ghcr.io/image
with:
args: ./symbiflow-examples-tests.sh
Additional information
Equivalent use cases are successful if docker is executed directly in a run step, instead of using the uses: docker:// syntax. See:
- https://github.com/hdl/containers/blob/GHA-MWEs/.github/workflows/MWE-1560-SymbiFlow.yml
- https://github.com/hdl/containers/actions/workflows/MWE-1560-SymbiFlow.yml
- https://github.com/hdl/containers/blob/GHA-MWEs/.github/workflows/MWE-1560.yml
- https://github.com/hdl/containers/actions/workflows/MWE-1560.yml
Ref: #1530
@umarcor can you provide a small repro about the issue?
@TingluoHuang just updated the comment above (I created the issue first in order to have a number).
Hmmm, interestingly, 2 of the 3 reduced examples are working. I simplified it too much... I will update.
@TingluoHuang, see:
- https://github.com/hdl/containers/blob/GHA-MWEs/.github/workflows/MWE-1560-F4PGA.yml
- https://github.com/hdl/containers/actions/workflows/MWE-1560-F4PGA.yml
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 15 days.
😕
Have you ever found a workaround for this?