aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/actions/deploy-request/action.yml4
-rwxr-xr-x.github/actions/deploy-request/request.sh14
-rw-r--r--.github/workflows/checks.yml3
3 files changed, 17 insertions, 4 deletions
diff --git a/.github/actions/deploy-request/action.yml b/.github/actions/deploy-request/action.yml
index 6f1a22d80..9703b66ad 100644
--- a/.github/actions/deploy-request/action.yml
+++ b/.github/actions/deploy-request/action.yml
@@ -12,6 +12,9 @@ inputs:
api_user_token:
description: "the user API token to use for API calls"
required: true
+ reports_folder:
+ description: "Where to store requests and responses files."
+ required: true
runs:
using: "docker"
@@ -22,6 +25,7 @@ runs:
- ${{ inputs.ref }}
- ${{ inputs.api_user_name }}
- ${{ inputs.api_user_token }}
+ - ${{ inputs.reports_folder }}
branding:
icon: 'package'
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}"
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index b57182aea..7359cba43 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -193,8 +193,9 @@ jobs:
ref: ${{ github.ref }}
api_user_name: ${{ secrets.BOT_MASTER_RW_GITHUB_USERNAME }}
api_user_token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}
+ reports_folder: deploy-reports
- uses: actions/upload-artifact@v1.0.0
if: always()
with:
name: deploy-request
- path: /tmp/deploy-request
+ path: deploy-reports