Upgrade pipeline is not targeting the correct remote ref

Summary

In our scheduled pipeline set up to test the sylva upgrade. We are doing a git checkout on the initial git reference (tag: 1.0.3) and try to deploy, after that we try to update targetting the main branch.

The git checkout is done correctly but, in common.sh we have the definition of the current commit:

export CURRENT_COMMIT=${CI_COMMIT_SHA:-$(git rev-parse HEAD)}

CI_COMMIT_SHA is set to the latest main commit and take precedence over the `

git rev-parse HEAD

so we are trying to deploy main remote with 1.0.3 code

related references

Details