From 448b7dad95cc5003f29fd9096ed25b3baad6dab1 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Fri, 20 Aug 2021 18:40:02 -0400 Subject: [PATCH 01/14] Test FIX --- entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 4e46c3e..83c83f8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -38,6 +38,11 @@ TARGET_DIR=$(mktemp -d) # including "." and with the exception of ".git/" mv "$CLONE_DIR/.git" "$TARGET_DIR" +#echo "[+] Deleting files from $DESTINATION_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" +#rm -rfv "$CLONE_DIR/$DESTINATION_DIRECTORY"/* +#echo "[+] Veryfing that the directory that will be pushed is EMPTY" +#ls -la "$CLONE_DIR/$DESTINATION_DIRECTORY" + if [ ! -d "$SOURCE_DIRECTORY" ] then echo "ERROR: $SOURCE_DIRECTORY does not exist" @@ -49,6 +54,7 @@ then echo "to the target repository: you need to clone the source repository" echo "in a previous step in the same build section. For example using" echo "actions/checkout@v2. See: https://github.com/cpina/push-to-another-repository-example/blob/main/.github/workflows/ci.yml#L16" + mkdir "$SOURCE_DIRECTORY" exit 1 fi From 520a9d8c28da0042a003e0228984e90c496a6606 Mon Sep 17 00:00:00 2001 From: Michael Ryan Date: Sat, 12 Jun 2021 01:46:38 -0400 Subject: [PATCH 02/14] Allows pushing to target directory in target repo Signed-off-by: Eliminater74 --- action.yml | 5 +++++ entrypoint.sh | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 7501040..723b6f4 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,10 @@ inputs: description: '[Optional] commit message for the output repository. ORIGIN_COMMIT is replaced by the URL@commit in the origin repo' default: 'Update from ORIGIN_COMMIT' required: false + target-directory: + description: '[Optional] The directory to wipe and replace in the target repository' + default: '.' + required: false runs: using: 'docker' image: 'Dockerfile' @@ -41,6 +45,7 @@ runs: - ${{ inputs.destination-repository-username }} - ${{ inputs.target-branch }} - ${{ inputs.commit-message }} + - ${{ inputs.target-directory }} branding: icon: 'git-commit' color: 'green' diff --git a/entrypoint.sh b/entrypoint.sh index 83c83f8..149e54f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,6 +12,7 @@ USER_NAME="$5" DESTINATION_REPOSITORY_USERNAME="$6" TARGET_BRANCH="$7" COMMIT_MESSAGE="$8" +TARGET_DIRECTORY="$9" if [ -z "$DESTINATION_REPOSITORY_USERNAME" ] then @@ -32,11 +33,18 @@ git config --global user.name "$USER_NAME" git clone --single-branch --branch "$TARGET_BRANCH" "https://$USER_NAME:$API_TOKEN_GITHUB@github.com/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git" "$CLONE_DIR" ls -la "$CLONE_DIR" -TARGET_DIR=$(mktemp -d) +TEMP_DIR=$(mktemp -d) # This mv has been the easier way to be able to remove files that were there # but not anymore. Otherwise we had to remove the files from "$CLONE_DIR", # including "." and with the exception of ".git/" -mv "$CLONE_DIR/.git" "$TARGET_DIR" +mv "$CLONE_DIR/.git" "$TEMP_DIR/.git" + +# Remove contents of target directory and create a new empty one +rm -R "$CLONE_DIR/$TARGET_DIRECTORY/" +mkdir "$CLONE_DIR/$TARGET_DIRECTORY" + +mv "$TEMP_DIR/.git" "$CLONE_DIR/.git" + #echo "[+] Deleting files from $DESTINATION_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" #rm -rfv "$CLONE_DIR/$DESTINATION_DIRECTORY"/* @@ -59,8 +67,8 @@ then fi echo "Copy contents to target git repository" -cp -ra "$SOURCE_DIRECTORY"/. "$TARGET_DIR" -cd "$TARGET_DIR" +cp -ra "$SOURCE_DIRECTORY"/. "$CLONE_DIR/$TARGET_DIRECTORY" +cd "$CLONE_DIR" echo "Files that will be pushed:" ls -la From f87dd897167fbab0578562330adc71563accb810 Mon Sep 17 00:00:00 2001 From: Michael Ryan Date: Sat, 12 Jun 2021 01:50:16 -0400 Subject: [PATCH 03/14] Modified so this could be deployed to github marketplace Signed-off-by: Eliminater74 --- README.md | 7 +++++-- action.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a6839fd..4424cfb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# github-action-push-to-another-repository +# github-action-push-to-another-repository-directory When to use this GitHub Action? It is useful in case that you have a GitHub repository with a a directory that you want to push to another GitHub repository using GitHub Actions (automated on push, for example). It is also useful if using GitHub Actions you generate certain files that you want to push to another GitHub repository. @@ -6,7 +6,7 @@ Flow: The [example repository](https://github.com/cpina/push-to-another-repository-example) has a MarkDown file [main.md](https://github.com/cpina/push-to-another-repository-example/blob/main/main.md)), during the [GitHub Actions flow](https://github.com/cpina/push-to-another-repository-example/blob/main/.github/workflows/ci.yml#L19) it executes [build.sh](https://github.com/cpina/push-to-another-repository-example/blob/main/build.sh) and the output/ directory (configurable via [source-directory](https://github.com/cpina/push-to-another-repository-example/blob/main/.github/workflows/ci.yml#L27) appears in the [output repository](https://github.com/cpina/push-to-another-repository-output). -Please bear in mind: files in the target repository are deleted. This is to make sure that it contains only the generated files in the last run without previously generated files. +Please bear in mind: files in the target repository's specified directory are deleted. This is to make sure that it contains only the generated files in the last run without previously generated files. There are different variables to setup the behaviour: @@ -37,6 +37,9 @@ The branch name for the destination repository. It defaults to `main` for histor ### `commit-message` (argument) [optional] The commit message to be used in the output repository. Optional and defaults to "Update from $REPOSITORY_URL@commit". +### `target-branch` (argument) [optional] +The directory to wipe and replace in the target repository. Defaults to wiping the entire repository + The string `ORIGIN_COMMIT` is replaced by `$REPOSITORY_URL@commit`. ### `API_TOKEN_GITHUB` (environment) diff --git a/action.yml b/action.yml index 723b6f4..371c052 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: 'Push directory to another repository' +name: 'Push directory to another repository directory' description: 'Useful to push files to another repository to be used, for example, via github pages' inputs: source-directory: From 12ff072138b4fcf5c49f333388bb1c3b8a22a3c8 Mon Sep 17 00:00:00 2001 From: Michael Ryan Date: Sat, 12 Jun 2021 02:06:21 -0400 Subject: [PATCH 04/14] Fixed mistake in readme Signed-off-by: Eliminater74 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4424cfb..1f5ff35 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ The branch name for the destination repository. It defaults to `main` for histor ### `commit-message` (argument) [optional] The commit message to be used in the output repository. Optional and defaults to "Update from $REPOSITORY_URL@commit". -### `target-branch` (argument) [optional] +### `target-directory` (argument) [optional] The directory to wipe and replace in the target repository. Defaults to wiping the entire repository The string `ORIGIN_COMMIT` is replaced by `$REPOSITORY_URL@commit`. From 67a3a057c8f41da716759bafc5c1e542098b94b4 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Fri, 20 Aug 2021 19:23:03 -0400 Subject: [PATCH 05/14] Update: enterypoint.sh --- entrypoint.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 149e54f..dd62fc6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,7 +26,7 @@ fi CLONE_DIR=$(mktemp -d) -echo "Cloning destination git repository" +echo "[+] Cloning destination git repository $DESTINATION_REPOSITORY_NAME" # Setup git git config --global user.email "$USER_EMAIL" git config --global user.name "$USER_NAME" @@ -39,18 +39,14 @@ TEMP_DIR=$(mktemp -d) # including "." and with the exception of ".git/" mv "$CLONE_DIR/.git" "$TEMP_DIR/.git" +echo "[+] Deleting files from $DESTINATION_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" # Remove contents of target directory and create a new empty one rm -R "$CLONE_DIR/$TARGET_DIRECTORY/" -mkdir "$CLONE_DIR/$TARGET_DIRECTORY" +echo "[+] Creating $TARGET_DIRECTORY if doesnt already exist" +mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY" mv "$TEMP_DIR/.git" "$CLONE_DIR/.git" - -#echo "[+] Deleting files from $DESTINATION_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" -#rm -rfv "$CLONE_DIR/$DESTINATION_DIRECTORY"/* -#echo "[+] Veryfing that the directory that will be pushed is EMPTY" -#ls -la "$CLONE_DIR/$DESTINATION_DIRECTORY" - if [ ! -d "$SOURCE_DIRECTORY" ] then echo "ERROR: $SOURCE_DIRECTORY does not exist" @@ -66,27 +62,28 @@ then exit 1 fi +echo "[+] Copying contents of source repository folder $SOURCE_DIRECTORY to folder $DESTINATION_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" echo "Copy contents to target git repository" cp -ra "$SOURCE_DIRECTORY"/. "$CLONE_DIR/$TARGET_DIRECTORY" cd "$CLONE_DIR" -echo "Files that will be pushed:" +echo "[+] Files that will be pushed" ls -la ORIGIN_COMMIT="https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" COMMIT_MESSAGE="${COMMIT_MESSAGE/ORIGIN_COMMIT/$ORIGIN_COMMIT}" COMMIT_MESSAGE="${COMMIT_MESSAGE/\$GITHUB_REF/$GITHUB_REF}" -echo "git add:" +echo "[+] Adding git commit" git add . -echo "git status:" +echo "[+] git status:" git status -echo "git diff-index:" +echo "[+] git diff-index:" # git diff-index : to avoid doing the git commit failing if there are no changes to be commit git diff-index --quiet HEAD || git commit --message "$COMMIT_MESSAGE" -echo "git push origin:" +echo "[+] Pushing git commit" # --set-upstream: sets de branch when pushing to a branch that does not exist git push "https://$USER_NAME:$API_TOKEN_GITHUB@github.com/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git" --set-upstream "$TARGET_BRANCH" From b97d556c1df1ad3198e2ebf25b8d3ded6b2d07e4 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Fri, 20 Aug 2021 19:30:49 -0400 Subject: [PATCH 06/14] Update: action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 371c052..c0c09d0 100644 --- a/action.yml +++ b/action.yml @@ -22,8 +22,8 @@ inputs: required: false default: '' target-branch: - description: '[Optional] set target branch name for the destination repository. Defaults to "master" for historical reasons' - default: 'master' + description: '[Optional] set target branch name for the destination repository. Defaults to "main" for historical reasons' + default: 'main' required: false commit-message: description: '[Optional] commit message for the output repository. ORIGIN_COMMIT is replaced by the URL@commit in the origin repo' From b646e274db5d1fb022b65c3b5bf67a1a8b7c86c7 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Fri, 20 Aug 2021 20:54:32 -0400 Subject: [PATCH 07/14] Update: entrypoint.sh --- entrypoint.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index dd62fc6..5d7a57a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,7 +3,7 @@ set -e # if a command fails it stops the execution set -u # script fails if trying to access to an undefined variable -echo "Starts" +echo "[+] Action start" SOURCE_DIRECTORY="$1" DESTINATION_GITHUB_USERNAME="$2" DESTINATION_REPOSITORY_NAME="$3" @@ -39,9 +39,13 @@ TEMP_DIR=$(mktemp -d) # including "." and with the exception of ".git/" mv "$CLONE_DIR/.git" "$TEMP_DIR/.git" -echo "[+] Deleting files from $DESTINATION_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" +echo "[+] Checking if $TARGET_DIRECTORY exist in git repo $DESTINATION_REPOSITORY_NAME" # Remove contents of target directory and create a new empty one +if [ -d "$CLONE_DIR/$TARGET_DIRECTORY/" ] +then +echo "[+] Deleting files from $TARGET_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" rm -R "$CLONE_DIR/$TARGET_DIRECTORY/" +fi echo "[+] Creating $TARGET_DIRECTORY if doesnt already exist" mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY" @@ -58,12 +62,10 @@ then echo "to the target repository: you need to clone the source repository" echo "in a previous step in the same build section. For example using" echo "actions/checkout@v2. See: https://github.com/cpina/push-to-another-repository-example/blob/main/.github/workflows/ci.yml#L16" - mkdir "$SOURCE_DIRECTORY" exit 1 fi -echo "[+] Copying contents of source repository folder $SOURCE_DIRECTORY to folder $DESTINATION_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" -echo "Copy contents to target git repository" +echo "[+] Copying contents of source repository folder $SOURCE_DIRECTORY to folder $TARGET_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" cp -ra "$SOURCE_DIRECTORY"/. "$CLONE_DIR/$TARGET_DIRECTORY" cd "$CLONE_DIR" From b4480ee4f3ebc6fdfe5ea77952a2df33373ae0c7 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Sat, 21 Aug 2021 08:28:35 -0400 Subject: [PATCH 08/14] Dockerfile: FROM alpine:latest --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d27f30b..4baf5a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.12 +FROM alpine:latest RUN apk add --no-cache git From 7a8c60c186da1a2ccfaa114676d03e12a069f252 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Sun, 29 Aug 2021 08:24:21 -0400 Subject: [PATCH 09/14] Add some fixes --- action.yml | 4 ++++ entrypoint.sh | 23 ++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index c0c09d0..029ea78 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,9 @@ name: 'Push directory to another repository directory' description: 'Useful to push files to another repository to be used, for example, via github pages' inputs: + source-before-directory: + description: 'Source before directory from the origin directory' + required: false source-directory: description: 'Source directory from the origin directory' required: true @@ -37,6 +40,7 @@ runs: using: 'docker' image: 'Dockerfile' args: + - ${{ inputs.source-before-directory }} - ${{ inputs.source-directory }} - ${{ inputs.destination-github-username }} - ${{ inputs.destination-repository-name }} diff --git a/entrypoint.sh b/entrypoint.sh index 5d7a57a..394d46b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,15 +4,16 @@ set -e # if a command fails it stops the execution set -u # script fails if trying to access to an undefined variable echo "[+] Action start" -SOURCE_DIRECTORY="$1" -DESTINATION_GITHUB_USERNAME="$2" -DESTINATION_REPOSITORY_NAME="$3" -USER_EMAIL="$4" -USER_NAME="$5" -DESTINATION_REPOSITORY_USERNAME="$6" -TARGET_BRANCH="$7" -COMMIT_MESSAGE="$8" -TARGET_DIRECTORY="$9" +SOURCE_BEFORE_DIRECTORY="$1" +SOURCE_DIRECTORY="$2" +DESTINATION_GITHUB_USERNAME="$3" +DESTINATION_REPOSITORY_NAME="$4" +USER_EMAIL="$5" +USER_NAME="$6" +DESTINATION_REPOSITORY_USERNAME="$7" +TARGET_BRANCH="$8" +COMMIT_MESSAGE="$9" +TARGET_DIRECTORY="$10" if [ -z "$DESTINATION_REPOSITORY_USERNAME" ] then @@ -51,6 +52,10 @@ mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY" mv "$TEMP_DIR/.git" "$CLONE_DIR/.git" + +echo "[+] Changing to $SOURCE_BEFORE_DIRECTORY" +cd $SOURCE_BEFORE_DIRECTORY + if [ ! -d "$SOURCE_DIRECTORY" ] then echo "ERROR: $SOURCE_DIRECTORY does not exist" From 52acf3c68c094093fa23d75bd2cd0263b479a155 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Sun, 29 Aug 2021 09:26:38 -0400 Subject: [PATCH 10/14] fixme --- entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 394d46b..24a78d2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,7 +13,7 @@ USER_NAME="$6" DESTINATION_REPOSITORY_USERNAME="$7" TARGET_BRANCH="$8" COMMIT_MESSAGE="$9" -TARGET_DIRECTORY="$10" +TARGET_DIRECTORY="${10}" if [ -z "$DESTINATION_REPOSITORY_USERNAME" ] then @@ -56,6 +56,10 @@ mv "$TEMP_DIR/.git" "$CLONE_DIR/.git" echo "[+] Changing to $SOURCE_BEFORE_DIRECTORY" cd $SOURCE_BEFORE_DIRECTORY + +echo "[+] List contecnts of $SOURCE_DIRECTORY" +ls $SOURCE_DIRECTORY + if [ ! -d "$SOURCE_DIRECTORY" ] then echo "ERROR: $SOURCE_DIRECTORY does not exist" From ed4074dd02ce4109b4d6c3cfac269371c16e6499 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Sun, 29 Aug 2021 09:30:34 -0400 Subject: [PATCH 11/14] Another fix --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 24a78d2..99c4389 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -45,7 +45,7 @@ echo "[+] Checking if $TARGET_DIRECTORY exist in git repo $DESTINATION_REPOSITOR if [ -d "$CLONE_DIR/$TARGET_DIRECTORY/" ] then echo "[+] Deleting files from $TARGET_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" -rm -R "$CLONE_DIR/$TARGET_DIRECTORY/" +rm -R "${CLONE_DIR:?}/$TARGET_DIRECTORY/" fi echo "[+] Creating $TARGET_DIRECTORY if doesnt already exist" mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY" From 38d751da52dd8ca31676d1f298f5973e9f7e3e4d Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Sun, 29 Aug 2021 18:07:37 -0400 Subject: [PATCH 12/14] Update action.yml Script: Cleanup --- action.yml | 62 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/action.yml b/action.yml index 029ea78..bb093bc 100644 --- a/action.yml +++ b/action.yml @@ -1,23 +1,27 @@ -name: 'Push directory to another repository directory' -description: 'Useful to push files to another repository to be used, for example, via github pages' +name: Push directory to another repository directory +description: >- + Useful to push files to another repository to be used, for example, via github + pages inputs: source-before-directory: - description: 'Source before directory from the origin directory' + description: Source before directory from the origin directory required: false source-directory: - description: 'Source directory from the origin directory' + description: Source directory from the origin directory required: true destination-github-username: - description: 'Name of the destination username/organization' + description: Name of the destination username/organization required: true destination-repository-name: - description: 'Destination repository' + description: Destination repository required: true user-email: - description: 'Email for the git commit' + description: Email for the git commit required: true user-name: - description: '[Optional] Name for the git commit. Defaults to the destination username/organization name' + description: >- + [Optional] Name for the git commit. Defaults to the destination + username/organization name required: false default: '' destination-repository-username: @@ -25,31 +29,35 @@ inputs: required: false default: '' target-branch: - description: '[Optional] set target branch name for the destination repository. Defaults to "main" for historical reasons' - default: 'main' + description: >- + [Optional] set target branch name for the destination repository. Defaults + to "main" for historical reasons + default: main required: false commit-message: - description: '[Optional] commit message for the output repository. ORIGIN_COMMIT is replaced by the URL@commit in the origin repo' - default: 'Update from ORIGIN_COMMIT' + description: >- + [Optional] commit message for the output repository. ORIGIN_COMMIT is + replaced by the URL@commit in the origin repo + default: Update from ORIGIN_COMMIT required: false target-directory: description: '[Optional] The directory to wipe and replace in the target repository' - default: '.' + default: . required: false runs: - using: 'docker' - image: 'Dockerfile' + using: docker + image: Dockerfile args: - - ${{ inputs.source-before-directory }} - - ${{ inputs.source-directory }} - - ${{ inputs.destination-github-username }} - - ${{ inputs.destination-repository-name }} - - ${{ inputs.user-email }} - - ${{ inputs.user-name }} - - ${{ inputs.destination-repository-username }} - - ${{ inputs.target-branch }} - - ${{ inputs.commit-message }} - - ${{ inputs.target-directory }} + - '${{ inputs.source-before-directory }}' + - '${{ inputs.source-directory }}' + - '${{ inputs.destination-github-username }}' + - '${{ inputs.destination-repository-name }}' + - '${{ inputs.user-email }}' + - '${{ inputs.user-name }}' + - '${{ inputs.destination-repository-username }}' + - '${{ inputs.target-branch }}' + - '${{ inputs.commit-message }}' + - '${{ inputs.target-directory }}' branding: - icon: 'git-commit' - color: 'green' + icon: git-commit + color: green From 2708e223bca08ca1c0e7281b594bc9f2907e85b8 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Sun, 29 Aug 2021 18:15:51 -0400 Subject: [PATCH 13/14] Update entrypoint.sh Cleanup --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 99c4389..6efc764 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -54,11 +54,11 @@ mv "$TEMP_DIR/.git" "$CLONE_DIR/.git" echo "[+] Changing to $SOURCE_BEFORE_DIRECTORY" -cd $SOURCE_BEFORE_DIRECTORY +cd "$SOURCE_BEFORE_DIRECTORY" echo "[+] List contecnts of $SOURCE_DIRECTORY" -ls $SOURCE_DIRECTORY +ls "$SOURCE_DIRECTORY" if [ ! -d "$SOURCE_DIRECTORY" ] then From 44d7a5c0f9e9350e6d948961b718b2f5be2b1027 Mon Sep 17 00:00:00 2001 From: Eliminater74 Date: Tue, 31 Aug 2021 06:04:57 -0400 Subject: [PATCH 14/14] Update Fix --- entrypoint.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6efc764..7ec1178 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -52,14 +52,23 @@ mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY" mv "$TEMP_DIR/.git" "$CLONE_DIR/.git" +echo "[+] Listing Current Directory Location" +ls -al +#echo "[+] Listing home+ Directory Location" +#ls -al /home/runner/work/Action_OpenWRT_AutoBuild_Linksys_Devices/Action_OpenWRT_AutoBuild_Linksys_Devices/openwrt +echo "[+] Listing root Location" +ls -al / +echo "[+] Listing /home Location" +ls -al /home -echo "[+] Changing to $SOURCE_BEFORE_DIRECTORY" -cd "$SOURCE_BEFORE_DIRECTORY" +# echo "[+] Changing to $SOURCE_BEFORE_DIRECTORY" +# cd "$SOURCE_BEFORE_DIRECTORY" -echo "[+] List contecnts of $SOURCE_DIRECTORY" +echo "[+] List contents of $SOURCE_DIRECTORY" ls "$SOURCE_DIRECTORY" +echo "[+] Checking if local $SOURCE_DIRECTORY exist" if [ ! -d "$SOURCE_DIRECTORY" ] then echo "ERROR: $SOURCE_DIRECTORY does not exist"