diff --git a/.github/workflows/scripts/publishNuInstallationExample.sh b/.github/workflows/scripts/publishNuInstallationExample.sh index 1045395428b..6133c75b727 100755 --- a/.github/workflows/scripts/publishNuInstallationExample.sh +++ b/.github/workflows/scripts/publishNuInstallationExample.sh @@ -1,24 +1,22 @@ #!/bin/bash -e -# Define folder to push -FOLDER_TO_PUSH="examples/installation/" +if [ -z "$ACCESS_TOKEN" ]; then + echo "ACCESS_TOKEN variable has to be defined" + exit 1 +fi -# Define target repository details -TARGET_OWNER="TouK" -TARGET_REPO="nussknacker-installation-example" -TARGET_BRANCH="master" # adjust as needed +git config --global credential.useHttpPath true -# Clone the target repository -git clone https://github.com/$TARGET_OWNER/$TARGET_REPO.git temp_repo +rm -rf nu-installation-example-repo +git clone git@github.com:TouK/nussknacker-installation-example.git nu-installation-example-repo # Copy the folder to the cloned repository -rm -rf temp_repo/* -cp -r $FOLDER_TO_PUSH temp_repo/ +rm -rf nu-installation-example-repo/* +cp -r "examples/installation/" nu-installation-example-repo/ -# Push the changes to the target repository -cd temp_repo +cd nu-installation-example-repo git config user.email "actions@github.com" git config user.name "GitHub Actions" git add . git commit -m "Push $FOLDER_TO_PUSH from source repository" -git push -f origin $TARGET_BRANCH +git push -f origin "master" diff --git a/.github/workflows/sync_installation_example.yml b/.github/workflows/sync-installation-example.yml similarity index 100% rename from .github/workflows/sync_installation_example.yml rename to .github/workflows/sync-installation-example.yml