From 4530ef7f426027093f610fc7a84ee27972df96d2 Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Sat, 25 Apr 2020 13:11:35 +0100 Subject: [PATCH] Unset repository env --- entrypoint.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 35b4fb5..c56289c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,8 +3,10 @@ export WORKSPACE_REPOSITORY="$INPUT_REPOSITORY" export CRAWLER_REPOSITORY="$INPUT_CRAWLER" export OUTPUT_REPOSITORY="$INPUT_OUTPUT" +unset INPUT_REPOSITORY # Clone crawler +echo "Cloning crawler..." mkdir /crawler export GITHUB_WORKSPACE="/crawler" @@ -12,7 +14,13 @@ export GITHUB_REPOSITORY="$CRAWLER_REPOSITORY" node /checkout.js +# Install crawler dependencies +echo "Installing crawler dependencies..." +cd /crawler +npm install + # Clone workspace +echo "Cloning workspace..." mkdir /workspace export GITHUB_WORKSPACE="/workspace" @@ -21,14 +29,12 @@ export GITHUB_REPOSITORY="$WORKSPACE_REPOSITORY" node /checkout.js # Inject .env from workspace +echo "Injecting .env from workspace..." touch /workspace/.env cp /workspace/.env /crawler/.env -# Install crawler dependencies -cd /crawler -npm install - # Clone output +echo "Cloning output..." mkdir /output export GITHUB_WORKSPACE="/output" @@ -37,20 +43,24 @@ export GITHUB_REPOSITORY="$OUTPUT_REPOSITORY" node /checkout.js # Run crawler +echo "Running crawler..." export OUTPUT="/output" export EMAIL="$INPUT_EMAIL" export PASSWORD="$INPUT_PASSWORD" +ls /crawler node /crawler/index.js -# Commit the changes +# Commit changes +echo "Commiting changes..." cd /output git add . git commit -m "$INPUT_COMMITMESSAGE" # Push changes +echo "Pushing changes..." force_option="" if $INPUT_FORCE; then