From 6af78799edd07b5301494de20aaecee28f51af27 Mon Sep 17 00:00:00 2001 From: Krzysztof Kwiatosz Date: Tue, 3 Dec 2024 14:54:29 +0100 Subject: [PATCH] Download btp cli as part of force-delete action (#63) * add checkout to locally executed action * download btp cli in the same gh action --- .../action.yaml | 7 +++++-- .github/actions/setup-btp/action.yaml | 21 ------------------- 2 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 .github/actions/setup-btp/action.yaml diff --git a/.github/actions/force-delete-sap-btp-subaccount/action.yaml b/.github/actions/force-delete-sap-btp-subaccount/action.yaml index 945b05b..a8b49bd 100644 --- a/.github/actions/force-delete-sap-btp-subaccount/action.yaml +++ b/.github/actions/force-delete-sap-btp-subaccount/action.yaml @@ -24,11 +24,14 @@ inputs: runs: using: 'composite' steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-btp - name: Force delete btp resources shell: bash run: | + sudo ln -sf bash /bin/sh + curl -LJO https://tools.hana.ondemand.com/additional/btp-cli-linux-amd64-latest.tar.gz --cookie "eula_3_2_agreed=tools.hana.ondemand.com/developer-license-3_2.txt" + tar -zxf btp-cli-linux-amd64-latest.tar.gz --strip-components=1 -C /usr/local/bin + rm -f btp-cli-linux-amd64-latest.tar.gz + echo "BTP CLI downloaded into /usr/local/bin/btp" btp login --url "${{ inputs.btp_backend_url }}" --user "${{ inputs.btp_user }}" --password "${{ inputs.btp_password }}" --idp "${{ inputs.btp_idp_tenant }}" --subdomain "${{ inputs.btp_global_account }}" echo "Deleting ${{ inputs.btp_global_account }}/${{ inputs.btp_subaccount_id }}". btp delete accounts/subaccount "${{ inputs.btp_subaccount_id }}" --global-account "${{ inputs.btp_global_account }}" --force-delete true --confirm true diff --git a/.github/actions/setup-btp/action.yaml b/.github/actions/setup-btp/action.yaml deleted file mode 100644 index 7515995..0000000 --- a/.github/actions/setup-btp/action.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: 'Setup BTP CLI' -description: 'Action for the BTP CLI setup' - -inputs: - path: - description: 'path where BTP CLI should be installed' - required: false - default: "/usr/local/bin" - -runs: - using: 'composite' - steps: - - name: Install BTP CLI - shell: bash - run: | - sudo ln -sf bash /bin/sh - mkdir -p ${{ inputs.path }} - curl -LJO https://tools.hana.ondemand.com/additional/btp-cli-linux-amd64-latest.tar.gz --cookie "eula_3_2_agreed=tools.hana.ondemand.com/developer-license-3_2.txt" - tar -zxf btp-cli-linux-amd64-latest.tar.gz --strip-components=1 -C ${{ inputs.path }} - rm -f btp-cli-linux-amd64-latest.tar.gz - echo "BTP CLI downloaded into ${{ inputs.path }}" \ No newline at end of file