Error when deploying hugo wuith GitLab pages

I have a GitLab pages repo, using Hugo. It was working perfectly, but on the last commit, with no changes to Hugo or CI configuration, the deployment stopped working. I get in the log for the deployment, the following error (in the script stage):

`Error: command error: unknown command "sh" for "hugo"`

This happened in gitlab.com. The config file(.gitlab-ci.yml ) is as follows:

default:
  image: "${CI_TEMPLATE_REGISTRY_HOST}/pages/hugo:latest"

variables:
  GIT_SUBMODULE_STRATEGY: recursive

test:  # builds and tests your site
  script:
    - hugo
  rules:
    - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH

pages:  # a predefined job that builds your pages and saves them to the specified path.
  script:
    - hugo --buildDrafts --buildFuture
  artifacts:
    paths:
      - public
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  environment: production

I’ve tried changing the config file (slight modifications), but it didn’t work. Any idea?

I’ve checked the solution provided in Error: command error: unknown command “sh” for “hugo”, which seems to be the same problem.

For me, changing the first two lines of .gitlab-ci.yml to the following ones fixed the issue (I also had to change to the pages/hugo/hugo_extended image, but that seems to be a separate issue:

image:
  name: "${CI_TEMPLATE_REGISTRY_HOST}/pages/hugo/hugo_extended:latest"
  entrypoint: [""]

hugo_extended is required when you need to compile SCSS to CSS.