Search code examples
javascriptreact-nativeexpogithub-actionscicd

can I run custom JS file in Expo as a script in GitHub actions?


I have a folder bin and inside some script example.js with content

#!/usr/bin/env node

console.log("Run my code!");

and I want to add run that script as a job in GitHub actions

  - name: 📦 Install dependencies
    run: yarn install
        
  - name: 📗 Trigger my test script
    run: yarn test

btw my package.json:

  "start": "expo start",
  "test": "./bin/example.js"

I am getting in the logs Permission denied.

My question is how can I afford this magic? Maybe Expo doesn't recognize #!/usr/bin/env node?


Solution

  • The answer was jonrsharpe comment (thank you): instead this "test": "./bin/example.js" I added "test": "node ./bin/example.js"