GitLab Pipeline Error: Cannot perform an interactive login from a non TTY device

Getting this vexing error in my GitLab pipeline. I’m using variables of course and setting them as protected. The bugaboo here is that the variables only get exported in pipelines that are running on a protected branch/tag. Make sure not to have the variable set as protected if you plan on using it with branches/tags that are not protected. You too will enjoy the super helpful error message if you forget this strategy.

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.