Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Meister <[email protected]>
  • Loading branch information
dennismeister93 committed May 6, 2024
1 parent 22df956 commit c478b10
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions .github/actions/update-velocitas-json/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/.velocitas.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": {
"devenv-devcontainer-setup": "hash_id"
"devenv-github-workflows": "hash_id"
},
"variables": {
"language": "cpp",
Expand Down
2 changes: 1 addition & 1 deletion test/python/.velocitas.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": {
"devenv-devcontainer-setup": "hash_id"
"devenv-github-workflows": "hash_id"
},
"variables": {
"language": "python",
Expand Down

0 comments on commit c478b10

Please sign in to comment.