Need to run bash script file

Hi,
I’m trying to run a script file which is located in a folder (BPM/tests/runTests.sh). my code is available below while running this script.

name: Java CI with Maven

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11
    - name: Maven version
      run: mvn -version
    - name: npm version
      run: npm -version
    - name: runing the Bash Command to execute Both Tests
      run: .github/BPM/tests/runTests.sh

when this workflow executes. it gives me error code 127 and also the message no directory found. you can find the attached screenshot below.

I’d need to see your repository to be sure, but there are two possibilities:

  1. The file doesn’t exist in your repository. I notice that in your post you give the file name as BPM/tests/runTests.sh, but the workflow uses .github/BPM/tests/runTests.sh, so there might be some mixup.
  2. The file isn’t marked as executable. You can either change that, or run it with Bash (like bash script.sh).

Thanks @airtower-luna. This would be helpful.

1 Like