GitHub Theme publish error

I have been using the GitHub publish action over the last several years successfully with a custom theme. I have not run the publish action in the past several months but when I tried to today I received an error about the node version being out of date. I corrected this but using the latest version of the publish action found here.

Even still I’m receiving an error when I publish which is different that the one mentioned above about the node version. Looking at the log, I see the following error.

 adding: home.hbs (deflated 71%)
AxiosError: Request failed with status code 403
    at settle (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:40657:12)
    at BrotliDecompress.handleStreamEnd (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:41756:11)
    at BrotliDecompress.emit (node:events:531:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
    at Axios.request (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:42567:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (/home/runner/work/_actions/TryGhost/action-deploy-theme/v1/dist/index.js:43140:9) {
  code: 'ERR_BAD_REQUEST'

Does anyone know what could be wrong and how to fix this? Thank you.

The issue was that “Bot Fight Mode” was turned on behind my Cloudflare proxied ghost install. When I disabled this setting my theme publishing began working again. Enabling the new Block AI Scrapers and Crawlers feature does not cause any issues with the GitHub theme publishing.

Does anyone know the solution to this? I have the exact same situation with the exact same error, after using GitHub actions with Ghost for years. I turned off the “Bot Fight Mode”, but nothing changes. Any help is appreciated.

It might be helpful to turn the Cloudflare proxying off entirely off to see if the behavior changes. (Not just bot fight mode, but all of it.)

If your deploy works, then you’ll know it’s something in your proxy setup. If it’s still broken, then you can exonerate Cloudflare and move on to investigating other options.

1 Like

Thanks for responding. I tried all of this, but no luck. I always get the same error.

Cloudflare is also not something new. I’ve been using it for a long time and everything worked until a few days ago, and it’s the same across all of my Ghost websites.

I don’t know what the exact solution was, but I used this .yml file and once again regenerated the credentials (after previously doing the same about 3 times). And it somehow started working.

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.6
        with:
          api-url: ${{ secrets.GHOST_ADMIN_API_URL }}
          api-key: ${{ secrets.GHOST_ADMIN_API_KEY }}
      

Go AWF > Tool

Add AS8075 and allow

Cloudflare will allow Github bypass their firewall.

However, ghost explorer will still block your site if fight bot turn on.

1 Like

The most updated action code is slighly different from the one you posted. Have you tried this version?

1 Like

Thanks for answering

Thanks. I know and tried. But it works now with the code I posted.

That’s a great tip. Is there a similar filter for ghost explore to work?