From 6be268ed16729845fd987eb5f26c4822b1f3230e Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Tue, 2 Apr 2024 09:59:48 -0700 Subject: [PATCH 1/2] add optional base path --- action.yml | 5 +++++ setup-shared-env.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index fbae135..c86871b 100644 --- a/action.yml +++ b/action.yml @@ -10,6 +10,10 @@ inputs: description: Regex to match environments which will be pushed to directly required: false default: .*(development|integration).* + base-path: + description: Base path for directories base and env directories + required: false + default: '.' pr-environment-regex: description: | Regex to match environments which will push to a @@ -78,6 +82,7 @@ runs: shell: bash working-directory: ${{ inputs.working-directory }} env: + BASE_PATH: ${{ inputs.base-path }} ENV: ${{ inputs.environment }} PUSH_ENVIRONMENT_REGEX: ${{ steps.detect-push-environment.outputs.match }} PR_ENVIRONMENT_REGEX: ${{ steps.detect-pr-environment.outputs.match }} diff --git a/setup-shared-env.sh b/setup-shared-env.sh index 9b08b67..97c5b38 100755 --- a/setup-shared-env.sh +++ b/setup-shared-env.sh @@ -8,7 +8,7 @@ set -e DEPLOY_REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" echo "DEPLOY_REPO_URL=${DEPLOY_REPO_URL}" >> "${GITHUB_ENV}" -ENV_DIR="env/${ENV}" +ENV_DIR="${BASE_PATH}env/${ENV}" echo "ENV_DIR=${ENV_DIR}" >> "${GITHUB_ENV}" ENV_BRANCH="$(echo "${ENV_DIR}" | tr "/" "-")" From a03bfeff4c6ec4fc1f9c35a5de12a7d288e027e3 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Wed, 3 Apr 2024 09:15:39 -0700 Subject: [PATCH 2/2] add slash --- setup-shared-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-shared-env.sh b/setup-shared-env.sh index 97c5b38..6c8804f 100755 --- a/setup-shared-env.sh +++ b/setup-shared-env.sh @@ -8,7 +8,7 @@ set -e DEPLOY_REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" echo "DEPLOY_REPO_URL=${DEPLOY_REPO_URL}" >> "${GITHUB_ENV}" -ENV_DIR="${BASE_PATH}env/${ENV}" +ENV_DIR="${BASE_PATH}/env/${ENV}" echo "ENV_DIR=${ENV_DIR}" >> "${GITHUB_ENV}" ENV_BRANCH="$(echo "${ENV_DIR}" | tr "/" "-")"