Skip to content

Commit

Permalink
Parse config yaml file with yq
Browse files Browse the repository at this point in the history
  • Loading branch information
mrakitin committed Mar 25, 2024
1 parent c079483 commit 28cdb3a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v4

- name: Install Python for shyaml
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install YAML CLI tools
run: |
python3 -m pip install shyaml yq
- name: Set env vars
run: |
set -vxeuo pipefail
Expand All @@ -40,7 +49,8 @@ jobs:
echo "CONDA_PACK_TEMPLATE_DIR=${CONDA_PACK_TEMPLATE_DIR}" >> $GITHUB_ENV
# env_name=$(cat configs/config-py${PYTHONVER}.yml | shyaml get-value env_name)
env_name=$(cat configs/config-py${PYTHONVER}.yml | grep -e "^env_name:" | cut -d ":" -f2 | sed 's/ //g; s/"//g')
env_name=$(cat configs/config-py${PYTHONVER}.yml | yq ".env_name")
# env_name=$(cat configs/config-py${PYTHONVER}.yml | grep -e "^env_name:" | cut -d ":" -f2 | sed 's/ //g; s/"//g')
export CONDA_PACK_ENV_NAME=${env_name}
echo "CONDA_PACK_ENV_NAME=${CONDA_PACK_ENV_NAME}" >> $GITHUB_ENV
Expand Down

0 comments on commit 28cdb3a

Please sign in to comment.