I'm having Github workflow to run a python file. Before running the python file I want to swap user so that no sudo is required to execute the python file.
I tried with 'su' but it's says su must be run from command line. How to do that through Github Workflow. Thank you
.yaml
name: CI
on:
  push:
     branches: [ main ]
  workflow_dispatch:
jobs:
  build:
    runs-on: self-hosted
    strategy:
      matrix:
        python: [3.8.1]
        
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python }}
    - name: run multiple commands
      run: |
        echo $PWD
        whoami 
        su - user
        python helloworld.py