authelia/pullup.sh

32 lines
803 B
Bash
Executable File

#!/bin/bash
commit_message=${1:-"pullup"}
update_submodule() {
local submodule_path="$1"
if [ -d "$submodule_path" ]; then
echo "Updating submodule: $submodule_path"
cd "$submodule_path" || return
git checkout main
git pull origin main
cd - || return
else
echo "Submodule path $submodule_path does not exist."
fi
}
# Update submodules ./.woodpecker/ and ./secrets/
update_submodule "./.woodpecker"
update_submodule "./secrets"
# Add changes to the staging area
git add .
# Commit changes with a custom message, if provided, or a default message
commit_message=${1:-"pullup"}
git commit -m "$commit_message"
# Push changes to the remote repository
git push
echo "Submodules are updated and changes are pushed to the main repository."