Skip to content

Conversation

@AnushaFF
Copy link
Contributor

Description

When the GitHub Action runs on the main branch after a merge, the script was comparing origin/main to HEAD. But since the code had already been merged to main, HEAD was pointing to the same commit as origin/main, resulting in zero detected changes. This PR updates the diff detection logic

@github-actions github-actions bot requested a review from pinkeshmars December 11, 2025 22:30
@AnushaFF AnushaFF requested review from agreaves and Copilot and removed request for pinkeshmars December 11, 2025 22:31
Copy link
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 fixes a critical issue in the GitHub Actions workflow where no file changes were being detected when running on the main branch after a merge. The solution introduces dynamic base commit detection using the GITHUB_BASE_SHA environment variable, which references the commit before the merge, ensuring proper diff detection.

Key Changes:

  • Modified update_docs.py to use GITHUB_BASE_SHA environment variable for diff comparison when available, falling back to origin/main for local development
  • Updated the workflow to fetch full Git history and pass the pre-merge commit SHA via github.event.before

Reviewed changes

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

File Description
update_docs.py Updated diff logic to use GITHUB_BASE_SHA environment variable instead of hardcoded origin/main
.github/workflows/update-docs-prod.yml Added full history fetch and set GITHUB_BASE_SHA to github.event.before for proper commit comparison

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

@AnushaFF AnushaFF merged commit bb867fb into main Dec 12, 2025
1 check passed
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