diff --git a/README.md b/README.md index 45e704a..98a7909 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ jobs: git-crypt export-key ./tmp-key && cat ./tmp-key | base64 | pbcopy && rm ./tmp-key ``` +### Run Directory + +You can run the git-crypt unlock command from a different directory besides GITHUB_WORKSPACE by setting a RUN_DIR env var. + ### Running tests ```shell script diff --git a/entrypoint.sh b/entrypoint.sh index b83baac..2142779 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,11 @@ set -eu +if [ -n "${RUN_DIR:-}" ]; then + cd ${RUN_DIR} + echo "Running git-crypt command from ${RUN_DIR}" +fi + echo "$GIT_CRYPT_KEY" | base64 -d > ./git-crypt-key git-crypt unlock ./git-crypt-key