From f5786f522ee89b44a4fdb40fa5c309d41c970922 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 15:31:54 -0300 Subject: [PATCH 01/20] Fix action test --- .github/workflows/action-test.yml | 12 ++++++++++-- action.yml | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index 873ec98..131d43c 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -15,10 +15,18 @@ jobs: ubuntu: runs-on: ubuntu-latest steps: - - name: Run test action without publish - uses: stack-spot/workflow-github-action-publish-content@main + - name: Run test action + uses: stack-spot/cli-github-action-run-command@main with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} realm: ${{ secrets.REALM }} command_stk: "--version" + + - name: Run test action again + uses: stack-spot/cli-github-action-run-command@main + with: + client_id: ${{ secrets.CLIENT_ID }} + client_key: ${{ secrets.CLIENT_KEY }} + realm: ${{ secrets.REALM }} + command_stk: "" diff --git a/action.yml b/action.yml index b6ce515..87b1318 100644 --- a/action.yml +++ b/action.yml @@ -16,8 +16,8 @@ inputs: required: true command_stk: description: Command STK - required: true - default: '--version' + required: false + default: '' runs: using: "composite" From c2909815e9c3f394dc61efd1f9ef4bff0da576a5 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 15:37:29 -0300 Subject: [PATCH 02/20] Fix action test --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 87b1318..b68facc 100644 --- a/action.yml +++ b/action.yml @@ -81,5 +81,5 @@ runs: shell: bash if: ${{ failure() }} run: | - cat $HOME/.stk/logs/* + [ -d "$HOME/.stk/logs/" ] && [ "$(ls -A $HOME/.stk/logs/)" ] && cat $HOME/.stk/logs/* exit 1 \ No newline at end of file From 272de31721cb296e9567284c075e433f71b0fdb1 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 15:41:00 -0300 Subject: [PATCH 03/20] Fix action test --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index b68facc..eb4e90d 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,7 @@ runs: - name: Check if STK CLI Installed id: check_cli shell: bash + continue-on-error: true run: | if command -v stk &> /dev/null then From 932d7c86d410a6ef3792abb521f28f07bf056e3e Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 15:43:37 -0300 Subject: [PATCH 04/20] Fix action test --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index eb4e90d..55da668 100644 --- a/action.yml +++ b/action.yml @@ -27,7 +27,7 @@ runs: shell: bash continue-on-error: true run: | - if command -v stk &> /dev/null + if [ "$(dpkg -l | grep stk)" ] then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" else From 1c3e10ed5b5e82f350413f957f94e03c77d3d5d6 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 15:58:55 -0300 Subject: [PATCH 05/20] Fix action test --- action.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 55da668..528427a 100644 --- a/action.yml +++ b/action.yml @@ -25,9 +25,8 @@ runs: - name: Check if STK CLI Installed id: check_cli shell: bash - continue-on-error: true run: | - if [ "$(dpkg -l | grep stk)" ] + if command -v stk &> /dev/null then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" else @@ -35,7 +34,7 @@ runs: fi - name: Download STK CLI - if: steps.output.check_cli.stk_installed == 'false' + if: env.STK_INSTALLED == 'true' shell: bash run: | curl \ @@ -49,17 +48,12 @@ runs: https://stk.stackspot.com/installer/linux/stk.deb - name: Install STK CLI - if: steps.output.check_cli.stk_installed == 'false' + if: env.STK_INSTALLED == 'true' shell: bash run: | sudo dpkg --install /tmp/stk.deb || echo "Installation failed with exit code: $?" export PATH=$PATH:$HOME/.stk/bin - - name: Verify if cli was installed - shell: bash - run: | - dpkg -l | grep stk - - name: Show STK CLI version shell: bash run: $HOME/.stk/bin/stk --version From 3dd1991efc362a9bd9ee71595e57764611f35648 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:03:01 -0300 Subject: [PATCH 06/20] Fix action test --- .github/workflows/action-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index 131d43c..6896391 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run test action - uses: stack-spot/cli-github-action-run-command@main + uses: stack-spot/cli-github-action-run-command@add-action with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} @@ -24,7 +24,7 @@ jobs: command_stk: "--version" - name: Run test action again - uses: stack-spot/cli-github-action-run-command@main + uses: stack-spot/cli-github-action-run-command@add-action with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} From 9a0a1f5db7ea049e7bbb10c432acdad7d746e44f Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:04:03 -0300 Subject: [PATCH 07/20] Fix action test --- .github/workflows/action-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index 6896391..6b065e8 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run test action - uses: stack-spot/cli-github-action-run-command@add-action + uses: ./ with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} @@ -24,7 +24,7 @@ jobs: command_stk: "--version" - name: Run test action again - uses: stack-spot/cli-github-action-run-command@add-action + uses: ./ with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} From 3b3b7e5416f8d6f5684e0929ef4d61b0ac7eb008 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:06:04 -0300 Subject: [PATCH 08/20] Fix action test --- .github/workflows/action-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index 6b065e8..d5b704e 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run test action - uses: ./ + uses: ../../ with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} @@ -24,7 +24,7 @@ jobs: command_stk: "--version" - name: Run test action again - uses: ./ + uses: ../../ with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} From a369d278c91b75c94b4550ffa4c2be8a2538bbd3 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:06:36 -0300 Subject: [PATCH 09/20] Fix action test --- .github/workflows/action-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index d5b704e..c8291a3 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run test action - uses: ../../ + uses: ../ with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} @@ -24,7 +24,7 @@ jobs: command_stk: "--version" - name: Run test action again - uses: ../../ + uses: ../ with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} From 93812ca97147b0002c2ac52b242466955da43a52 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:07:24 -0300 Subject: [PATCH 10/20] Fix action test --- .github/workflows/action-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index c8291a3..6b065e8 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run test action - uses: ../ + uses: ./ with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} @@ -24,7 +24,7 @@ jobs: command_stk: "--version" - name: Run test action again - uses: ../ + uses: ./ with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} From 43ff906f7950912fc703d76735cb4ab0de186e36 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:08:34 -0300 Subject: [PATCH 11/20] Fix action test --- .github/workflows/action-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index 6b065e8..6896391 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run test action - uses: ./ + uses: stack-spot/cli-github-action-run-command@add-action with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} @@ -24,7 +24,7 @@ jobs: command_stk: "--version" - name: Run test action again - uses: ./ + uses: stack-spot/cli-github-action-run-command@add-action with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} From 58c840a41b3e5c9efcd6d368671fc11fa0a153ba Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:09:33 -0300 Subject: [PATCH 12/20] Fix action test --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 528427a..300487f 100644 --- a/action.yml +++ b/action.yml @@ -34,7 +34,7 @@ runs: fi - name: Download STK CLI - if: env.STK_INSTALLED == 'true' + if: env.STK_INSTALLED == 'false' shell: bash run: | curl \ From 1e8c356db52c95fdfc58545ddd6e2b5b380de560 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:18:02 -0300 Subject: [PATCH 13/20] Fix action test --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 300487f..93de302 100644 --- a/action.yml +++ b/action.yml @@ -48,7 +48,7 @@ runs: https://stk.stackspot.com/installer/linux/stk.deb - name: Install STK CLI - if: env.STK_INSTALLED == 'true' + if: env.STK_INSTALLED == 'false' shell: bash run: | sudo dpkg --install /tmp/stk.deb || echo "Installation failed with exit code: $?" From 118345c2ad5e872caa4875272eeb8fe893019be3 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:19:46 -0300 Subject: [PATCH 14/20] Fix action test --- action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/action.yml b/action.yml index 93de302..5f6db0b 100644 --- a/action.yml +++ b/action.yml @@ -54,6 +54,17 @@ runs: sudo dpkg --install /tmp/stk.deb || echo "Installation failed with exit code: $?" export PATH=$PATH:$HOME/.stk/bin + - name: Check if STK CLI Installed + id: check_cli + shell: bash + run: | + if command -v stk &> /dev/null + then + echo "STK_INSTALLED=true" >> "$GITHUB_ENV" + else + echo "STK_INSTALLED=false" >> "$GITHUB_ENV" + fi + - name: Show STK CLI version shell: bash run: $HOME/.stk/bin/stk --version From 3811134b7932393b1e3087bc437a5831a26a3458 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:20:46 -0300 Subject: [PATCH 15/20] Fix action test --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5f6db0b..26e6cf6 100644 --- a/action.yml +++ b/action.yml @@ -55,7 +55,7 @@ runs: export PATH=$PATH:$HOME/.stk/bin - name: Check if STK CLI Installed - id: check_cli + id: check_cli2 shell: bash run: | if command -v stk &> /dev/null From b7bc48f4fb0dca130994b60b339bf03df2521ec4 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:39:25 -0300 Subject: [PATCH 16/20] Fix action test --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index 26e6cf6..36e35eb 100644 --- a/action.yml +++ b/action.yml @@ -26,6 +26,7 @@ runs: id: check_cli shell: bash run: | + command -v stk if command -v stk &> /dev/null then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" @@ -58,6 +59,7 @@ runs: id: check_cli2 shell: bash run: | + command -v stk if command -v stk &> /dev/null then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" From cf4e62a29cc83b6f5eb8d909b29f3bbad4257954 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:51:25 -0300 Subject: [PATCH 17/20] Fix action test --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index 36e35eb..2f6a184 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,6 @@ runs: id: check_cli shell: bash run: | - command -v stk if command -v stk &> /dev/null then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" From 8e73a87c2affa9431f7a970e9d1f1bcfc3f50f62 Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:55:40 -0300 Subject: [PATCH 18/20] Fix action test --- action.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 2f6a184..9852669 100644 --- a/action.yml +++ b/action.yml @@ -26,8 +26,7 @@ runs: id: check_cli shell: bash run: | - if command -v stk &> /dev/null - then + if [ -f "$HOME/.stk/bin/stk" ] then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" else echo "STK_INSTALLED=false" >> "$GITHUB_ENV" @@ -58,9 +57,7 @@ runs: id: check_cli2 shell: bash run: | - command -v stk - if command -v stk &> /dev/null - then + if [ -f "$HOME/.stk/bin/stk" ] then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" else echo "STK_INSTALLED=false" >> "$GITHUB_ENV" From 9b88381caba61a660adafd9ffcd7b782ce0b69cc Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 16:58:14 -0300 Subject: [PATCH 19/20] Fix action test --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 9852669..b185d98 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,7 @@ runs: id: check_cli shell: bash run: | - if [ -f "$HOME/.stk/bin/stk" ] then + if [ -f "$HOME/.stk/bin/stk" ]; then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" else echo "STK_INSTALLED=false" >> "$GITHUB_ENV" @@ -57,7 +57,7 @@ runs: id: check_cli2 shell: bash run: | - if [ -f "$HOME/.stk/bin/stk" ] then + if [ -f "$HOME/.stk/bin/stk" ]; then echo "STK_INSTALLED=true" >> "$GITHUB_ENV" else echo "STK_INSTALLED=false" >> "$GITHUB_ENV" From d0c805bd2a55bd5c34e4f5ddede64c7c6def615f Mon Sep 17 00:00:00 2001 From: "fabiano.fernandes@stg.stackspot.com" Date: Mon, 5 Aug 2024 17:00:55 -0300 Subject: [PATCH 20/20] Fix action test --- .github/workflows/action-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index 6896391..131d43c 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run test action - uses: stack-spot/cli-github-action-run-command@add-action + uses: stack-spot/cli-github-action-run-command@main with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }} @@ -24,7 +24,7 @@ jobs: command_stk: "--version" - name: Run test action again - uses: stack-spot/cli-github-action-run-command@add-action + uses: stack-spot/cli-github-action-run-command@main with: client_id: ${{ secrets.CLIENT_ID }} client_key: ${{ secrets.CLIENT_KEY }}