Skip to content

[DEV-4317] add full sync script#205

Open
MarBert wants to merge 7 commits into
DEV-4086-add-sync-script-from-mainfrom
DEV-4317-add-script-for-full-sync
Open

[DEV-4317] add full sync script#205
MarBert wants to merge 7 commits into
DEV-4086-add-sync-script-from-mainfrom
DEV-4317-add-script-for-full-sync

Conversation

@MarBert
Copy link
Copy Markdown
Collaborator

@MarBert MarBert commented May 28, 2026

This pull request enhances the repository synchronization workflow by introducing a distinction between incremental and full sync operations, and adds a new script to handle full synchronization. The changes ensure that only the necessary files are synced when specific paths are provided, while a complete sync is performed otherwise. This improves efficiency and clarity in the sync process.

Workflow improvements:

  • The GitHub Actions workflow in .github/workflows/push_on_public_repo.yml now conditionally runs either an incremental sync (using scripts/synch_repo.sh) when specific paths are provided, or a full sync (using the new scripts/sync_full_repo.sh) when no paths are specified. [1] [2]
  • The commit step now distinguishes between partial and full commits, only staging modified files for incremental syncs and all files for full syncs.

Script additions:

  • A new script, scripts/synch_full_repo.sh, has been added to handle full repository synchronization. It downloads a list of directory names from a remote JSON file, cleans the public docs directory, and copies the relevant directories from the private to the public repo, with appropriate checks and logging.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a split sync workflow for publishing documentation to the public repository, using incremental syncs when paths are provided and a full sync otherwise.

Changes:

  • Adds incremental sync script logic for selected add/remove paths.
  • Adds a full repository sync script driven by a remote directory list.
  • Updates the GitHub Actions workflow to choose between incremental and full sync and stage commits accordingly.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 6 comments.

File Description
scripts/synch_repo.sh Adds incremental copy/remove handling and emits modified files for staging.
scripts/synch_full_repo.sh Adds full docs sync by downloading a directory list, clearing public docs, and copying matching private docs.
.github/workflows/push_on_public_repo.yml Routes workflow execution to incremental or full sync and adjusts staging behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/synch_full_repo.sh Outdated
Comment on lines +12 to +22
echo "Downloading JSON file from $JSON_URL..."
JSON_CONTENT=$(curl -s "$JSON_URL")

echo "Extracting the path list..."
# Extracts strings between quotes, ignores the "dirNames" key, and removes the quotes
PATHS=$(echo "$JSON_CONTENT" | grep -o '"[^"]*"' | grep -v '"dirNames"' | tr -d '"')

echo "Cleaning up the directory $PUBLIC_DOCS_DIR..."
# Create the directory if it doesn't exist, otherwise empty its contents without deleting the root folder
mkdir -p "$PUBLIC_DOCS_DIR"
rm -rf "${PUBLIC_DOCS_DIR:?}/"*
Comment on lines +68 to +69
chmod +x scripts/sync_full_repo.sh
./scripts/sync_full_repo.sh
run: |
chmod +x scripts/synch_repo.sh
./scripts/synch_repo.sh
./scripts/synch_repo.sh
Comment thread scripts/synch_full_repo.sh Outdated
Comment on lines +25 to +27
for PATH_NAME in $PATHS; do
SRC_DIR="$PRIVATE_DOCS_DIR/$PATH_NAME"
DEST_DIR="$PUBLIC_DOCS_DIR/$PATH_NAME"
git add -A -- "$file"
fi
done
if [ -n "${{ inputs.paths_to_add }}" ] || [ -n "${{ inputs.paths_to_remove }}" ]; then
done
if [ -n "${{ inputs.paths_to_add }}" ] || [ -n "${{ inputs.paths_to_remove }}" ]; then
echo "Running partial commit..."
echo "${{ steps.sync_step.outputs.modified_files }}" | while IFS= read -r file; do
MarBert added 6 commits May 28, 2026 12:38
…cript-for-full-sync

# Conflicts:
#	.github/workflows/push_on_public_repo.yml
#	scripts/synch_repo.sh
…cript-for-full-sync

# Conflicts:
#	.github/workflows/push_on_public_repo.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants