Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
umarcor opened this issue Dec 16, 2021 · 6 comments
Open

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

umarcor opened this issue Dec 16, 2021 · 6 comments
Labels
enhancement New feature or request Runner Feature Feature scope to the runner

Comments

@umarcor
Copy link

umarcor commented Dec 16, 2021

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

@TingluoHuang
Copy link
Member

@umarcor can you provide a small repro about the issue?

@umarcor
Copy link
Author

umarcor commented Dec 16, 2021

@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.

@nikola-jokic nikola-jokic added the Runner Feature Feature scope to the runner label Mar 21, 2022
Copy link
Contributor

github-actions bot commented Mar 4, 2024

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.

@github-actions github-actions bot added the Stale label Mar 4, 2024
@umarcor
Copy link
Author

umarcor commented Mar 4, 2024

😕

@github-actions github-actions bot removed the Stale label Mar 11, 2024
@LecrisUT
Copy link

Have you ever found a workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Runner Feature Feature scope to the runner
Projects
None yet
Development

No branches or pull requests

4 participants