title: Run command with timeout in github workflow
body: <p>I have a GitHub action that resembles the code below. I have a file that is meant to run forever but get interrupted by a user when needed be. I've tried using <code>timeout</code> but it does not work, and gives some weird message.</p>
  <p>A small caveat to this, is that if the process is timed-out, I want this not to raise an error, so that the action continues and reports success. But if the python script itself fails, I want this to be reported, as running it for a while for debugging is the point of running it within the action.</p>
  <pre><code>name: Run file with interrupt then save results
  on: 
    push:
      branches: 
        - master
  
  jobs:
    build:
      strategy:
        matrix:
          python-version: [3.7]
      runs-on: ubuntu-latest
      steps:
        - name: Checkout
          uses: actions/checkout@v2
        - name: Set up Python ${{ matrix.python-version }}
          uses: actions/setup-python@v1
          with:
            python-version: ${{ matrix.python-version }}
        - name: Install dependencies for ex 06
          run: |
            python -m pip install --upgrade pip
            cd /home/runner/work/repo_name/repo_name
            pip install -r requirements.txt
        - name: Run file with timeout
          run: |
            cd /home/runner/work/repo_name/repo_name/
            echo &quot;hi1&quot;
            timeout 5 sleep 10
            echo &quot;hi2&quot;
            python RunsForever.py
            echo &quot;hi3&quot;
        - name: Upload results
          uses: actions/upload-artifact@v2
          with:
            name: result
            path: /home/runner/work/repo_name/repo_name/output/
  </code></pre>
  <p>How can I have timeout working properly? The current error message is:</p>
  <pre><code>Run cd /home/runner/work/repo_name/repo_name/
    cd /home/runner/work/repo_name/repo_name/
    echo &quot;hi1&quot;
    timeout 5 sleep 10
    echo &quot;hi2&quot;
    python RunsForever.py
    echo &quot;hi3&quot;
    shell: /bin/bash -e {0}
    env:
      pythonLocation: /opt/hostedtoolcache/Python/3.7.8/x64
  hi1
  ##[error]Process completed with exit code 124.
  </code></pre>
  <p>I don't understand what could be the issue. I expected the problem to be related to the timeout function hiding output from <code>RunsForever.py</code>, but actually <code>timeout</code> itself seems not to work. I've tried installing with <code>apt-get</code>, also to no avail.</p>
  <p>Is there some debugging that could get this running? Is there any other method to kill a process so I effectively interrupt it after a predetermined amount of time?</p>