From d85e69711848525f70680d7fb7966b48e681af1a Mon Sep 17 00:00:00 2001 From: Stefano Volpe Date: Fri, 3 Nov 2023 06:39:15 +0000 Subject: [PATCH] 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 Co-authored-by: Stefano Volpe Co-committed-by: Stefano Volpe --- Hugo/hugo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hugo/hugo.yml b/Hugo/hugo.yml index c6fcecd..9e005da 100644 --- a/Hugo/hugo.yml +++ b/Hugo/hugo.yml @@ -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