From c9efbed712ee00d11cf9db1ea35e2a2e5011ce4d Mon Sep 17 00:00:00 2001 From: "CMIP-IPO: Automated GitHub Action" Date: Fri, 17 Nov 2023 23:56:02 +0000 Subject: [PATCH] check writing to files --- .github/workflows/version_update.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/version_update.yml b/.github/workflows/version_update.yml index dd9ed3f15..1e50a4809 100644 --- a/.github/workflows/version_update.yml +++ b/.github/workflows/version_update.yml @@ -56,6 +56,18 @@ jobs: # working-directory: .github/libs # Adjusted the working directory shell: bash + - name: Display Version Metadata for JSON Files + run: | + # Get the list of JSON files in the repository + json_files=$(git ls-tree --name-only -r HEAD | grep '\.json$') + + # Iterate over each JSON file and display 'version_metadata' + for json_file in $json_files; do + metadata=$(git show HEAD:$json_file | jq -r '.version_metadata') + echo "File: $json_file, Version Metadata: $metadata" + done + shell: bash + - name: Write Changes run: |