I have a project where I'm using GitHub Actions for the CI / CD. I have a shell script where I would like to inject environment variables from my Actions yml. Here is what I have so far:
- name: docker-push
env:
USER: joesan
SOME_GITHUB_REPO_NAME: github-repo-name
GH_REPO: github.com/$USER/$SOME_GITHUB_REPO_NAME
run: |
echo "Running sbt assembly"
echo $GITHUB_REF
echo "Pushing tag into Docker Registry"
sh ./scripts/tag_deployment.sh
In the tag_deployment.sh, I'm trying to use these variables:
....
....
git clone https://${GH_REPO}
cd "${SOME_GITHUB_REPO_NAME}"
....
....
But I see when the action is run that it does not print what was set!
Cloning into '$SOME_GITHUB_REPO_NAME'...
fatal: unable to access 'https://github.com/$USER/$SOME_GITHUB_REPO_NAME/': The requested URL returned error: 400
How can I inject these environment variables properly into my shell script?