GitLab CI Warning: "git": executable file not found in $PATH

WARNING: current commit information was not captured by the build: git was not found in the system: exec: "git": executable file not found in $PATH

I saw this WARNING sail by while I was watching a Docker build process run on my GitLab CI pipeline. The build wasn’t failing but wasn’t completing cleanly. The GitLab runner image being used for this pipeline was:

image: python:3.9-slim

The solve came after a bit of experimentation and found that I needed to edit my .gitlab-ci.yml file to include the following:

before_script:
  - apk add --update --no-cache git

That edit solved the Warning and cleaned up the pipeline. Noted.

Hugo date error

I was firing up a Gitlab Pages site using Hugo today and ran across the following error

Failed to get translated string for language "en" and ID "postedOnDate": template: :1:13: executing "" at <.Count>: can't evaluate field Count in type string

Though the magic of grep I found two locations for the offender:

/themes/beautifulhugo/i18n/ja.yaml /themes/beautifulhugo/i18n/en.yaml

You’ll find the following bit of code here

- id: postedOnDate  translation: "Posted on {{ .Count }}"

Remove Count from the setting as shown in the following snippet and you’ll be golden

- id: postedOnDate  translation: "Posted on {{ . }}"