In Github workflow, to get all the secrets using the below command and assigning it to a variable To get all the secrets from stored secrets assigned into a variable (based on key (name of the variable) value
run: |
for keyval in $(grep -E '": [^\{]' <<< "$SECRETS_CONTEXT" | sed -e 's/: /=/' -e "s/\(\,\)$//"); do
echo "export $keyval"
eval export $keyval
done
Output export "var"=1 export "foo"="bar" export "x"="test"`
How can I export these variable as a global in Githubworkflow file. When I defined the steps it's not accessible from other steps.
steps:
- name: Import value
shell: bash
run: |
for keyval in $(grep -E '": [^\{]' <<< "$SECRETS_CONTEXT" | sed -e 's/: /=/' -e "s/\(\,\)$//"); do
echo "export $keyval"
eval export $keyval
done
Github secrets export in workflow