From 744e58311c403b4689b53d8c06f618ccb91aab11 Mon Sep 17 00:00:00 2001 From: Leeor Vardi Date: Fri, 13 Sep 2024 17:36:41 +0300 Subject: [PATCH 1/2] Update torque cli version in action.yaml --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index e56b3e8..b542859 100755 --- a/action.yaml +++ b/action.yaml @@ -18,7 +18,7 @@ inputs: runs: using: "docker" - image: "docker://qtorque/torque-cli:1.7" + image: "docker://quali/torque-cli:2.5.8" args: - env - end From 63fd5bd8bf8ed4f4b7e9cf4930e52f764cfaa2aa Mon Sep 17 00:00:00 2001 From: DBS Date: Fri, 7 Nov 2025 00:55:23 -0600 Subject: [PATCH 2/2] Add Dockerfile and entrypoint script for ending Torque environments --- Dockerfile | 5 +++++ action.yaml | 7 +++---- entrypoint.sh | 25 +++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 Dockerfile create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b1d33f4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM quali/torque-cli:2.5.8 + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/action.yaml b/action.yaml index b542859..c6914e6 100755 --- a/action.yaml +++ b/action.yaml @@ -18,17 +18,16 @@ inputs: runs: using: "docker" - image: "docker://quali/torque-cli:2.5.8" + image: "Dockerfile" args: - - env - - end - ${{ inputs.environment_id }} + - ${{ inputs.space }} env: TORQUE_TOKEN: ${{ inputs.torque_token }} TORQUE_SPACE: ${{ inputs.space }} TORQUE_HOSTNAME: ${{ inputs.torque_hostname }} - TORQUE_USERAGENT: Torque-Plugin-Github-Env-Environment-Action/v1 + TORQUE_USERAGENT: Torque-Plugin-Github-Start-Environment-Action/v1 branding: icon: 'stop-circle' diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..16bee79 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,25 @@ +#!/bin/sh -l + +ENV_ID="$1" +SPACE="$2" + +echo "Ending environment with id '${ENV_ID}' in space '${SPACE}'" +params="\"${ENV_ID}\" --space \"${SPACE}\"" + +command="/Quali.Torque.Cli/torque-cli env end ${params} --token $TORQUE_TOKEN" +echo "The following command will be executed: ${command}" + +echo "Ending environment..." +response=$(eval $command 2>&1) +exit_code=$? +if [ $exit_code -ne 0 ]; then + echo "Error: Failed to end environment" + echo "$response" + exit $exit_code +fi + +echo "Environment ended successfully." + +echo "Writing data to outputs" +echo "environment_id=${ENV_ID}" >> $GITHUB_OUTPUT +