Below is my gitlab-ci.yml file, where I have 2 stages.
stages:
- upload
- publish
upload-file:
stage: upload
script:
- <command>
when: manual
publish-file:
stage: publish
script:
- command --fileId=1234 # Need to read fileId from the upload-file job output
needs: [upload-theme]
when: manual
When the first job 'upload-file' is successful, it outputs below json
{
"fileId": "ef595c63-b5cb-453d-8f3a-8ad2697a0526"
}
I need to access this fileId in my second job -> 'publish-file'. How can I achieve this? Please advise.
file.txtto? it needs to be relative to the project dir.Paths are relative to the project directory ($CI_PROJECT_DIR) and can’t directly link outside it.