From 8bb6e569a44580f79314fffd2f781d46b6a810c1 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Thu, 16 Feb 2023 18:48:05 +0100 Subject: [PATCH 1/7] added prefix input to action.yml --- action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 9cd08d4..3e61a22 100644 --- a/action.yml +++ b/action.yml @@ -7,12 +7,15 @@ inputs: target: description: 'Target directory for ghuser files' required: true + prefix: + description: 'Add this prefix to the name of each generated component' + required: false runs: using: 'composite' steps: - run: nuget install Grasshopper -OutputDirectory ./lib -source https://api.nuget.org/v3/index.json shell: pwsh - - run: ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib + - run: ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib --prefix ${{ inputs.prefix }} shell: pwsh branding: icon: 'box' From 6b37adc95c07dee2bd6fc7f5c1184daf361a5843 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Mon, 8 May 2023 14:51:49 +0200 Subject: [PATCH 2/7] optional prefix flag --- action.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3e61a22..14b9898 100644 --- a/action.yml +++ b/action.yml @@ -13,9 +13,15 @@ inputs: runs: using: 'composite' steps: + - run: | + command="ipy ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib" + prefix="${{ inputs.prefix }}" + if [ -n "$prefix" ]; then + command="$command --prefix $prefix" + fi - run: nuget install Grasshopper -OutputDirectory ./lib -source https://api.nuget.org/v3/index.json shell: pwsh - - run: ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib --prefix ${{ inputs.prefix }} + - run: $command shell: pwsh branding: icon: 'box' From a83f558d27ebc342be4493e4990c45a1d443f212 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Mon, 8 May 2023 16:53:19 +0200 Subject: [PATCH 3/7] fixed if syntax --- action.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index 14b9898..f38ea69 100644 --- a/action.yml +++ b/action.yml @@ -13,15 +13,15 @@ inputs: runs: using: 'composite' steps: - - run: | - command="ipy ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib" - prefix="${{ inputs.prefix }}" - if [ -n "$prefix" ]; then - command="$command --prefix $prefix" - fi - run: nuget install Grasshopper -OutputDirectory ./lib -source https://api.nuget.org/v3/index.json shell: pwsh - - run: $command + - run: | + command="ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib" + prefix="${{ inputs.prefix }}" + if [ -n "$prefix" ]; then + command="$command --prefix $prefix" + fi + $command shell: pwsh branding: icon: 'box' From 40af9a7dba4aacc37c149b97442d261a9ea191cc Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Mon, 8 May 2023 16:56:58 +0200 Subject: [PATCH 4/7] fixed the fixed if syntax --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f38ea69..e40c696 100644 --- a/action.yml +++ b/action.yml @@ -18,7 +18,7 @@ runs: - run: | command="ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib" prefix="${{ inputs.prefix }}" - if [ -n "$prefix" ]; then + if [[ -n "$prefix" ]]; then command="$command --prefix $prefix" fi $command From 6962f1e1c7b0900d08811fabef6fdf31a7df7dce Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Mon, 8 May 2023 17:04:52 +0200 Subject: [PATCH 5/7] ah why didn't you say its powershell --- action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index e40c696..0ef684e 100644 --- a/action.yml +++ b/action.yml @@ -18,9 +18,10 @@ runs: - run: | command="ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib" prefix="${{ inputs.prefix }}" - if [[ -n "$prefix" ]]; then + if( $null -ne $prefix ) + { command="$command --prefix $prefix" - fi + } $command shell: pwsh branding: From 712d362ab6a6481d138619a8970cfde02062cac6 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Mon, 8 May 2023 17:37:31 +0200 Subject: [PATCH 6/7] fixed variable syntax --- action.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 0ef684e..ec6c157 100644 --- a/action.yml +++ b/action.yml @@ -16,13 +16,14 @@ runs: - run: nuget install Grasshopper -OutputDirectory ./lib -source https://api.nuget.org/v3/index.json shell: pwsh - run: | - command="ipy ${{ github.action_path }}/componentize.py ${{ inputs.source }} ${{ inputs.target }} --ghio ./lib" - prefix="${{ inputs.prefix }}" + $command="ipy" + $params="${{ github.action_path }}/componentize.py", "${{ inputs.source }}", "${{ inputs.target }}", "--ghio", "./lib" + $prefix="${{ inputs.prefix }}" if( $null -ne $prefix ) { - command="$command --prefix $prefix" + $params=$params + "--prefix", "$prefix" } - $command + & $command $params shell: pwsh branding: icon: 'box' From a9bd354eec30bb8ca4f6e0602e8725b09694d0a8 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Mon, 8 May 2023 17:41:28 +0200 Subject: [PATCH 7/7] string is not empty check --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ec6c157..a24768c 100644 --- a/action.yml +++ b/action.yml @@ -19,7 +19,7 @@ runs: $command="ipy" $params="${{ github.action_path }}/componentize.py", "${{ inputs.source }}", "${{ inputs.target }}", "--ghio", "./lib" $prefix="${{ inputs.prefix }}" - if( $null -ne $prefix ) + if( $prefix ) { $params=$params + "--prefix", "$prefix" }