self-hosted not using bashrc

I can source it, but by default nothing from bashrc is loaded into the runtime at launch.

Should I update a different file instead bashrc? We have several additions to our base image to support multiple engineering workflows and dependencies, including a rather lengthy PATH.

I’ve suggested people source bashrc, but typically this is something that is expected in the linux world that when you have a shell, the environment loads with any configurations.

Is there any plan to automatically source bashrc? 

Hi @everops-alex , 

Currently Github Actions invoke bash scripts in non-interactive mode, it will not load .bashrc by default.  

>> Is there any plan to automatically source bashrc? 

I would recommend you submiting this requirement in the Feedback form for GitHub Actions

1 Like

You can use custom shell, @everops-alex:

https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#custom-shell

For example, the template of “bash” shell is:

bash --noprofile --norc -eo pipefail {0}

So to make it source the rc files before running the script, you can use (-l flag is needed to invoke bash as login shell, see “Invocation” section in bash’s man page for more info):

bash -leo pipefail {0}

_Edited: _I used -I instead of -l in the reply

2 Likes

Is it possible to set this for the whole workflow?

You could use defaults.run to provide default shell options for all run steps in a workflow.

name: use bashrc
defaults:
  run:
    shell: bash -ieo pipefail {0}
on: 
 push:
jobs: 
  job1:
    ......
1 Like