Github Actions - error

Hi all,

I just figured out how to deploy github actions via github, however, on deploy I receive this error.

@tryghost/admin-api Config Invalid: 'url' *** requires a protocol. E.g. 'https://site.com'

Any idea whats going on here?

It seems like you didn’t provide a valid url :wink:

If the action requires secrets, make sure those secrets are configured

Hi @vikaspotluri123 I provided the url as in the example. My url is https://paolotrulli.com is that not correct?

Secrets are configured as per the instructions.

*edit spelling

I am still trying to get this to work

I moved on from the privous error but now I am getting this

Run TryGhost/action-deploy-theme@v1.4.1
2
  with:
3
    api-url: ***
4
    api-key: ***
5
Error: Cannot find module '/home/runner/work/my-blog/my-blog/package.json'
6
Require stack:
7
- /home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js
8
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
9
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
10
    at Module.require (internal/modules/cjs/loader.js:852:19)
11
    at require (internal/modules/cjs/helpers.js:74:18)
12
    at main (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:1560:62)
13
    at Object.104 (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:1578:2)
14
    at __webpack_require__ (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:24:31)
15
    at startup (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:43:19)
16
    at /home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:47:18
17
    at Object.<anonymous> (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:50:10) {
18
  code: 'MODULE_NOT_FOUND',
19
  requireStack: [
20
    '/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js'

Any idea how to address this?

You’re missing a package.json file which means your theme won’t be valid. Has it passed gscan?

Sorry for my ignorance, but what is gscan?

It’s Ghost’s theme linter. You have to have a valid package.json in your theme, but since you don’t have one at all, the GitHub Action is crashing.

You can see it at https://gscan.ghost.org

Hi @vikaspotluri123, here is a screen shot of the theme and its gscan result.

What’s your git repo look like? Is your theme code in a subdirectory?

It is yes, I have a repo called my-blog, which the Casper theme is inside of.

If it’s in a subdirectory, you need to set the working-directory key of the step to that subdirectory

Hello! Sorry to resurface this thread, but I’m having the exact same issue here. You cannot specify a working-directory with a Github Action uses case.

My error is (you can see the nested /ml/ml directories):

Run TryGhost/action-deploy-theme@v1.4.1
Error: Cannot find module '/home/runner/work/ml/ml/package.json'
Require stack:
- /home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at main (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:1560:62)
    at Object.104 (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:1578:2)
    at __webpack_require__ (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:24:31)
    at startup (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:43:19)
    at /home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:47:18
    at Object.<anonymous> (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js:50:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/TryGhost/action-deploy-theme/v1.4.1/dist/index.js'
  ]
}

I’ve tried setting a global working-directory for all the jobs, but this doesn’t work.

Thanks for any help!