Hi,
We have a project level variable (Commit_Id) that we would like to update in our yaml file if the pipeline job is successful. We’ve tried updating the variable in our after script ( export Commit_Id=$CI_COMMIT_SHA) in the below code snippet, but the variable is not getting updated . Is there a different syntax we should be using? Thank you.
Validate-Dev:
image: node:latest
tags:
- gitlab-org
stage: validate
only:
- /^Develop$/i
except:
variables:
- $SANDBOX_DISABLED
script:
- authenticate SANDBOX $Test_env
- echo y | sfdx plugins:install sfdx-git-delta
- sfdx sgd:source:delta --to "HEAD" --from "${Commit_Id}" --output Delta
- sfdx force:source:deploy -x Delta/package/package.xml -u SANDBOX -c
after_script:
- >
if [ $CI_JOB_STATUS == 'success' ]; then
export Commit_Id=$CI_COMMIT_SHA
else
echo 'Pipeline encountered an error'
fi
Versions
Please select whether options apply, and add the version information.
- GitLab.com SaaS