[Github Actions] AxiosError - code 413

I get this result when I try to deploy a Ghots forked theme on Github Actions:

  adding: custom-authors.hbs (deflated 58%)
  adding: archive.hbs (deflated 66%)
{
  "message": "Request failed with status code 413",
  "name": "AxiosError",
  "code": "ERR_BAD_REQUEST",
  "status": null
}

This is my code, copied from Ghost Github:

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

What can be the cause of this issue?

413 is “request too large”. So the theme you’re trying to upload is larger than the server will accept.

Assuming you’re uploading to a self-hosted instance, my first guess would be your max body size is too low on the server i.e. nginx.

If you can share more details about your setup, that would help with figuring out exactly what’s wrong.

2 Likes

Thanks Hanna, it did the trick.

On Nginx, for future references:

Syntax:   client_max_body_size size;
Default:  client_max_body_size 1m;
Context:  http, server, location

:link: Module ngx_http_core_module

1 Like