I am using git diff command in my gh action workflow to find directory updated in PR
When PR is opened I ran this command to find the changes
Git diff —-name-only origin/main origin/feature
And PR is closed I run this command to find the changes between merge commit and main branch last commit
As per my understanding GitHub.sha is the commit id of pull request merge
Git diff —-name-only github.pull.request.base.sha github.sha
It was working fine until last week but I see strange behavior this week
First git diff command gives me output containing few extra directories which haven’t even altered in the PR
And second command compares the changes between commit of GitHub pull request merge and previous days commit , instead of comparing changes between merge and main commits
And this is intermittent issue , few PRs works perfectly
The only change I can imagine is changing git repo settings to squash and merge
What is right approach in GitHub action to run git diff when pr is opened vs closed ?