diff options
Diffstat (limited to '.github/actions/deploy-request/request.sh')
| -rwxr-xr-x | .github/actions/deploy-request/request.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/.github/actions/deploy-request/request.sh b/.github/actions/deploy-request/request.sh index 7dc569005..e784ef7b3 100755 --- a/.github/actions/deploy-request/request.sh +++ b/.github/actions/deploy-request/request.sh @@ -4,8 +4,11 @@ set -e REF_TO_DEPLOY="${1}" API_USERNAME="${2}" API_TOKEN="${3}" +OUTPUT="${4}" -mkdir -p /tmp/deploy-request || true +TEMP_FOLDER="/tmp/${OUTPUT}" +rm -rf "${TEMP_FOLDER}" || true +mkdir -p "${TEMP_FOLDER}" function deployment_request() { echo "making request to: ${1}" @@ -16,10 +19,10 @@ function deployment_request() { --arg jsonDescription "${2}" \ '{ ref: $jsonRef, task: "deploy", auto_merge: false, environment: $jsonDeployTarget, description: $jsonDescription }' ) - local JSON_FILENAME="/tmp/deploy-request/deployment_request_${1}.json" + local JSON_FILENAME="${TEMP_FOLDER}/deployment_request_${1}.json" echo "${JSON_TEXT}" > "${JSON_FILENAME}" - curl -u "${API_USERNAME}:${API_TOKEN}" -o "/tmp/deploy-request/deployment_response_${1}.json" -d "@${JSON_FILENAME}" https://api.github.com/repos/AnySoftKeyboard/AnySoftKeyboard/deployments + curl -u "${API_USERNAME}:${API_TOKEN}" -o "${TEMP_FOLDER}/deployment_response_${1}.json" -d "@${JSON_FILENAME}" https://api.github.com/repos/AnySoftKeyboard/AnySoftKeyboard/deployments } #some deploy logic @@ -29,3 +32,8 @@ if [[ "${REF_TO_DEPLOY}" == "refs/heads/master" ]]; then elif [[ "${REF_TO_DEPLOY}" == "release-branch-v"* ]]; then deployment_request "app_beta" "Deployment request by ${API_USERNAME}" fi + +rm -rf "${OUTPUT}" || true +mkdir -p "${OUTPUT}" + +mv "${TEMP_FOLDER}" "${OUTPUT}" |
