From 5f0eb1adc6af37fa01e032ccb1e798ca56bb9e2a Mon Sep 17 00:00:00 2001 From: Nis Jespersen Date: Fri, 6 Dec 2024 09:04:42 +0100 Subject: [PATCH] refactor: task separation --- .github/workflows/schema-release.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/schema-release.yml b/.github/workflows/schema-release.yml index 56f34c0..6970865 100644 --- a/.github/workflows/schema-release.yml +++ b/.github/workflows/schema-release.yml @@ -22,6 +22,30 @@ jobs: - name: Prepare working directory run: mkdir -p docs/schemas + - name: Download and copy JSON schemas + run: | + echo "Download JSON schemas from release payload..." + JSON_SCHEMAS=$(echo '${{ toJson(github.event.client_payload.artefacts.jsonSchemas) }}' | jq -c '.') + + for schema in $(echo $JSON_SCHEMAS | jq -c '.[]'); do + FILE_NAME=$(echo $schema | jq -r '.fileName') + URL=$(echo $schema | jq -r '.url') + + echo "Downloading $FILE_NAME from $URL..." + curl -L $URL -o "docs/schemas/$FILE_NAME" + done + + - name: Download and data model diagram + run: | + echo "Download data model diagram from release payload..." + + DATA_MODEL=$(echo '${{ toJson(github.event.client_payload.artefacts.dataModel) }}' | jq -c '.') + DATA_MODEL_FILE_NAME=$(echo $DATA_MODEL | jq -r '.fileName') + DATA_MODEL_URL=$(echo $DATA_MODEL | jq -r '.url') + + echo "Downloading data model $DATA_MODEL_FILE_NAME from $DATA_MODEL_URL..." + curl -L $DATA_MODEL_URL -o "docs/schemas/$DATA_MODEL_FILE_NAME" + - name: Download and copy artefacts run: | echo "Extracting artefacts from release payload..." @@ -44,6 +68,8 @@ jobs: echo "Downloading data model $DATA_MODEL_FILE_NAME from $DATA_MODEL_URL..." curl -L $DATA_MODEL_URL -o "docs/schemas/$DATA_MODEL_FILE_NAME" + + - name: Commit changes run: | git config user.name "github-actions[bot]"