Skip to content

Support using a login shell along with the container step syntax #1560

@umarcor

Description

@umarcor

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:

Ref: #1530

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions