How to execute a script file using GitHub Action?

I am trying to run a bash script file inside GitHub Action, but it is return an error.

name: CI
on: push

    name: Linux build on node ${{ matrix.node_version }}
    runs-on: ubuntu-latest
        node_version: [8.x, 10.x]

    - name: Checkout
      uses: actions/checkout@v1

    - name: Set Node.js version ${{ matrix.node_version }}
      uses: actions/setup-node@v1
        node-version: ${{ matrix.node_version }}

    - name: Install packages
      run: npm install

    - name: Run build
      run: npm run build:linux

    - name: Moving build to artifacts directory
      run: ./scripts/
1 Like

Does it require GitHub Token to access to repository files?

1 Like

Looks like lack of execution permission. Have you tried to

chmod +x ./scripts/

and commiting the file?

Hi mittalyashu,

The file should be lack of execution permission. You can add an extra step to check the detail permission of the bash file.

ls -l ./scripts/

Two methods:

  1. Add prior step with command below:

    • name: Moving build to artifacts directory
      run: |
      chmod +x ./scripts/
  2. Or directly add ‘sh’ before the command:

    - name: Moving build to artifacts directory
    run: |
    sh ./scripts/


In case it is indeed an executable bit issue, I would suggest updating the executable bit using git instead, so everybody using this repo will have that file executable.

$ git update-index --chmod +x ./scripts/