Skip to content

fix: synchronize VM source scripts with the latest main branch before…#19

Merged
xukki241 merged 1 commit intomainfrom
dev
Mar 28, 2026
Merged

fix: synchronize VM source scripts with the latest main branch before…#19
xukki241 merged 1 commit intomainfrom
dev

Conversation

@xukki241
Copy link
Copy Markdown
Collaborator

… execution

Copilot AI review requested due to automatic review settings March 28, 2026 14:15
@xukki241 xukki241 merged commit 2de276d into main Mar 28, 2026
6 checks passed
Copy link
Copy Markdown

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

Updates the CD workflow’s VM deploy script to synchronize the deployment repo’s local scripts before continuing, aiming to ensure the VM uses the latest deployment scripts/config when running remote commands.

Changes:

  • Add a git fetch/checkout/pull sequence on the VM (when $DEPLOY_PATH contains a .git directory) before reading env/config and running deploy steps.

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

Comment on lines +177 to +182
# Keep VM source scripts in sync with latest main before running any local script.
if [ -d .git ]; then
git fetch origin
git checkout main
git pull --ff-only origin main
fi
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

This block force-checks out main on the VM even when the workflow is triggered by a release tag (startsWith(github.ref, 'refs/tags/v')). That means tag deployments will always run the latest main docker-compose.prod.yml / deploy/scripts rather than the scripts corresponding to the tagged commit, which can cause version mismatches (e.g., compose/service name or script expectation drift relative to the images being deployed).

If tag deploys should be reproducible, pass the desired ref (e.g., github.ref_name/github.sha) into the SSH step and check out that ref on the VM, or gate this sync block to only run on refs/heads/main deployments.

Copilot uses AI. Check for mistakes.
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