forked from docs/doc-exports
adding read of metadata
This commit is contained in:
@ -47,3 +47,30 @@ jobs:
|
||||
source ~/.venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e ./doc-convertor
|
||||
|
||||
parse-metadata-yaml:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install PyYAML
|
||||
run: pip install pyyaml
|
||||
|
||||
- name: Load YAML and set outputs
|
||||
id: metadata
|
||||
run: |
|
||||
python3 <<EOF > parsed.env
|
||||
import yaml, os
|
||||
with open("metadata.yaml") as f:
|
||||
data = yaml.safe_load(f)
|
||||
print(f"SERVICE_TITLE={data['categories']['security-services'][0]['service_title']}")
|
||||
print(f"SERVICE_TYPE={data['categories']['security-services'][0]['service_type']}")
|
||||
print(f"SERVICE_CATEGORY={data['categories']['security-services'][0]['service_category']}")
|
||||
EOF
|
||||
cat parsed.env >> $GITHUB_ENV
|
||||
|
||||
- name: Use config values
|
||||
run: |
|
||||
echo "SERVICE_TITLE: $SERVICE_TITLE"
|
||||
echo "SERVICE_TYPE: $SERVICE_TYPE"
|
||||
echo "SERVICE_CATEGORY: $SERVICE_CATEGORY"
|
||||
|
||||
Reference in New Issue
Block a user