From c478b1017c538358b48cb6811304f7d9a4d32053 Mon Sep 17 00:00:00 2001 From: Dennis Meister Date: Mon, 6 May 2024 12:59:01 +0200 Subject: [PATCH] Fix review comments Signed-off-by: Dennis Meister --- .github/actions/update-velocitas-json/action.yml | 16 ++++++++-------- .github/workflows/ci.yml | 4 ++-- test/cpp/.velocitas.json | 2 +- test/python/.velocitas.json | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/actions/update-velocitas-json/action.yml b/.github/actions/update-velocitas-json/action.yml index db6ef62..35a27b4 100644 --- a/.github/actions/update-velocitas-json/action.yml +++ b/.github/actions/update-velocitas-json/action.yml @@ -15,11 +15,11 @@ name: update-velocitas-json description: Update the project's velocitas JSON. inputs: - project_path: - description: Path to the directory containing the Velocitas project + project_dir: + description: Directory containing the Velocitas project required: true - template_path: - description: Path to a JSON file which will replace the .velocitas.json file. + template_file: + description: JSON file which will replace the .velocitas.json file. default: None runs: using: composite @@ -30,10 +30,10 @@ runs: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BRANCH_NAME_PREFIX: "@" run: | - if [ "${{ inputs.template_path }}" != "None" ]; then + if [ "${{ inputs.template_file }}" != "None" ]; then echo "Copying template file..." - cp -f ${{ inputs.template_path }} ${{ inputs.project_path }}/.velocitas.json + cp -f ${{ inputs.template_file }} ${{ inputs.project_dir }}/.velocitas.json fi - NEW_CONFIG="$(jq --arg BRANCH "$BRANCH_NAME_PREFIX$BRANCH_NAME" '.packages |= . + { (. | keys_unsorted[0]): $BRANCH }' ${{ inputs.project_path }}/.velocitas.json)" - echo "${NEW_CONFIG}" > ${{ inputs.project_path }}/.velocitas.json + NEW_CONFIG="$(jq --arg BRANCH "$BRANCH_NAME_PREFIX$BRANCH_NAME" '.packages |= . + { (. | keys_unsorted[0]): $BRANCH }' ${{ inputs.project_dir }}/.velocitas.json)" + echo "${NEW_CONFIG}" > ${{ inputs.project }}/.velocitas.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecf376d..e49fb89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,8 +50,8 @@ jobs: - name: Update Velocitas JSON with correct version uses: ./.github/actions/update-velocitas-json with: - project_path: test/${{ matrix.language }}/repo - template_path: test/${{ matrix.language }}/.velocitas.json + project_dir_path: test/${{ matrix.language }}/repo + template_file_path: test/${{ matrix.language }}/.velocitas.json - name: Init velocitas project run: | diff --git a/test/cpp/.velocitas.json b/test/cpp/.velocitas.json index 364d867..669d7b0 100644 --- a/test/cpp/.velocitas.json +++ b/test/cpp/.velocitas.json @@ -1,6 +1,6 @@ { "packages": { - "devenv-devcontainer-setup": "hash_id" + "devenv-github-workflows": "hash_id" }, "variables": { "language": "cpp", diff --git a/test/python/.velocitas.json b/test/python/.velocitas.json index df46975..92b7461 100644 --- a/test/python/.velocitas.json +++ b/test/python/.velocitas.json @@ -1,6 +1,6 @@ { "packages": { - "devenv-devcontainer-setup": "hash_id" + "devenv-github-workflows": "hash_id" }, "variables": { "language": "python",