From my question "Gitlab CI: get list of files changed since last run" I discovered that Gitlab CI has no variable that tracks the SHA-ID of the last commit on which the pipeline has been executed.
I'm trying to save the commit ID on a .txt that will be sourced by a shell script (variable is like LAST_EXECUTED_SHA_ID=XYZ
). Now, after a pipeline execution I have to update such text file in order to track the current HEAD, changing LAST_EXECUTED_SHA_ID
to ZYX
. Now I have to: add the file, commit and push. I tried to do so using gitlab-runner both with a shell script and .gitlab-ci.yml file itself but I encounter several errors like "remote: You are not allowed to upload code."
Is there any way to fix this error? It seems like an ssh / auth token error or similar