TryGhost / action-deploy-theme

:octocat: Deploy your Ghost theme with Github Actions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Canary version deprecated in admin api

Geekfish opened this issue ยท comments

Hello ๐Ÿ‘‹

I've been trying to use this action to deploy a theme to my blog.

This is what my action yaml looks like:

name: Deploy Theme
on:
  push:
    branches:
      - prod
jobs:
  deploy:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3.1.0
      - name: Deploy Ghost Theme
        uses: TryGhost/action-deploy-theme@v1.6.1
        with:
          theme-name: mnml
          api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
          api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}

The github action fails raises a warning with the following error:

@tryghost/admin-api: The 'version' parameter has a deprecated format 'canary', please use 'v{major}.{minor}' format instead

I have traced this back to the admin api SDK dependency, which appears to have dropped support for 'canary' as a version.
However, this action always defaults it to canary.

Suggested solution

I believe that this can be resolved as follows:

  • Add an optional with param to specify version
  • When provided, pass it on to the admin api.
  • When not provided, omit it from the config.

Let me know what you think!

I just noticed that this seems to just log a warning (I amended the description above), which should not really fail the build.

I guess the original warning issue still stands. But I'm not sure why my build is failing, there's nothing really useful apart for this warning in the github action log.

same here, getting ( @tryghost/admin-api: The 'version' parameter has a deprecated format 'canary', please use 'v{major}.{minor}' format instead ) error

Getting this error as well!

This is not an error, it is just a warning

Github giving a deprecation warning when running this Action #77

Definitely an error for me, as it's failing to deploy with this as the reason
Screenshot 2022-12-17 at 9 53 39 am

This is not an error, it is just a warning

Here are my debug logs:

##[debug]Evaluating condition for step: 'Deploy Ghost Theme'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Deploy Ghost Theme
##[debug]Loading inputs
##[debug]Evaluating: secrets.GHOST_ADMIN_API_URL
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GHOST_ADMIN_API_URL'
##[debug]=> null
##[debug]Result: null
##[debug]Evaluating: secrets.GHOST_ADMIN_API_KEY
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'GHOST_ADMIN_API_KEY'
##[debug]=> null
##[debug]Result: null
##[debug]Loading env
Run TryGhost/action-deploy-theme@v1
@tryghost/admin-api: The 'version' parameter has a deprecated format 'canary', please use 'v{major}.{minor}' format instead
{}
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Deploy Ghost Theme

I've triple checked the admin URL and API, nothing works.

I have another Ghost installation where everything is working fine however

Hi, I have the same problem.

Hey guys. Here is a working action for you :)

name: Deploy Theme
on:
  push:
    branches:
      - master
      - main
jobs:
  deploy:
    runs-on: ubuntu-22.04
    steps:
      - run: echo "GHOST_ADMIN_API_URL is ${{ secrets.GHOST_ADMIN_API_URL }}"
      - uses: actions/checkout@v3.1.0
      - name: Deploy Ghost Theme
        uses: TryGhost/action-deploy-theme@v1.5.0
        with:
          api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
          api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
          theme-name: "<YOUR THEME NAME>"

Hey @RayLuxembourg ๐Ÿ‘‹

Downgrading TryGhost/action-deploy-theme to v1.5.0 to match your yaml and re-running the workflow finally returned some real errors. This time it complained about the URL and the API key being invalid. Not sure what was there before, I swear I had the correct values - but it was not possible to see them via echo because Github will automatically filter secret vars on the output. In any case, after re-adding the secrets, IT WORKED!

It also worked after I re-upgraded the action to 1.6.1. Really weird thing. But thank you for helping in any case!

when adding secrets there is some confusing option that's actually not an action secret, I fall into that trap and I saw with the echo it was an empty secret and fixed it.

  • run: echo "GHOST_ADMIN_API_URL is ${{ secrets.GHOST_ADMIN_API_URL }}"

I fell into the same trap! Thanks for the help @RayLuxembourg

Fixed with #80