Hugo workflow: use CI_COMMIT_SHA in commit message (#34)

Within the Hugo workflow, the commit message was built interpolating the `CI_BUILD_CREATED` builtin Woodpecker variable. I believe  it is not defined (anymore?): https://woodpecker-ci.org/docs/usage/environment. The most similar thing I have found is `CI_PIPELINE_CREATED`, but I can't get any value beside 0 out of it when using this pipeline. So I propose we use `CI_COMMIT_SHA`, which I already tested in one of my personal projects: https://ci.codeberg.org/repos/12701/pipeline/19/1.
I believe `CI_COMMIT_SHA` is the ideal unique identifier for pipeline triggered by push actions.

Reviewed-on: https://codeberg.org/Codeberg-CI/examples/pulls/34
Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org>
Co-authored-by: Stefano Volpe <stefano.volpe@student.uva.nl>
Co-committed-by: Stefano Volpe <stefano.volpe@student.uva.nl>
This commit is contained in:
Stefano Volpe 2023-11-03 06:39:15 +00:00 committed by Patrick Schratz
parent 18bcfb560c
commit d85e697118

View File

@ -50,7 +50,7 @@ steps:
# Commit and push all static files with pipeline started timestamp
- cd $CI_REPO_NAME
- git add .
- git commit -m "Woodpecker CI ${CI_BUILD_CREATED}"
- git commit -m "Woodpecker CI ${CI_COMMIT_SHA}"
- git push
when:
event: push