actions / actions/runner

Support using a login shell along with the container step syntax

Open
#1,560 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Runner Feature
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the three cases in the linked MWE-1560-SymbiFlow.yml and MWE-1560.yml workflows, comparing docker run steps with uses: docker:// steps. Trace the runner's container-step handling and verify that bash login-shell forms execute commands and produce the expected output.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, csharp
Domain
ci-cd, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.