Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canary version deprecated in admin api #76

Closed
Geekfish opened this issue Nov 12, 2022 · 12 comments
Closed

Canary version deprecated in admin api #76

Geekfish opened this issue Nov 12, 2022 · 12 comments

Comments

@Geekfish
Copy link

Geekfish commented Nov 12, 2022

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!

@Geekfish
Copy link
Author

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.

@caelumpirata
Copy link

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

@IzakJackson
Copy link

Getting this error as well!

@ErisDS
Copy link
Member

ErisDS commented Dec 16, 2022

This is not an error, it is just a warning

@IzakJackson
Copy link

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

@IzakJackson
Copy link

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

@ladislavsulc
Copy link

Hi, I have the same problem.

@RayLuxembourg
Copy link

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>"

Geekfish added a commit to Geekfish/mnml-ghost-theme that referenced this issue Jan 2, 2023
@Geekfish
Copy link
Author

Geekfish commented Jan 2, 2023

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!

@RayLuxembourg
Copy link

RayLuxembourg commented Jan 2, 2023

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.

@IzakJackson
Copy link

IzakJackson commented Jan 3, 2023

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

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

@royalfig
Copy link
Contributor

Fixed with #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants