Fix xplat sync to ignore @generated header (#29738)

Use some clever git diffing to ignore lines that only change the
`@generated` header. We can't do this for the version string because the
version string can be embedded in lines with other changes, but this
header is always on one line.
This commit is contained in:
Ricky
2024-06-03 16:39:38 -04:00
committed by GitHub
parent 4dcdf21325
commit 8c3697a849
2 changed files with 12 additions and 1 deletions

View File

@@ -329,7 +329,9 @@ jobs:
git status
echo "===================="
echo "Checking for changes"
if git status --porcelain | grep -qv '/REVISION'; then
# Check if there are changes in the files other than REVISION or @generated headers
# We also filter out the file name lines with "---" and "+++".
if git diff -- . ':(exclude)*REVISION' | grep -vE "^(@@|diff|index|\-\-\-|\+\+\+|@generated SignedSource)" | grep "^[+-]" > /dev/null; then
echo "Changes detected"
echo "should_commit=true" >> "$GITHUB_OUTPUT"
else