Skip to content

Commit 8c3697a

Browse files
authored
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.
1 parent 4dcdf21 commit 8c3697a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/commit_artifacts.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ jobs:
329329
git status
330330
echo "===================="
331331
echo "Checking for changes"
332-
if git status --porcelain | grep -qv '/REVISION'; then
332+
# Check if there are changes in the files other than REVISION or @generated headers
333+
# We also filter out the file name lines with "---" and "+++".
334+
if git diff -- . ':(exclude)*REVISION' | grep -vE "^(@@|diff|index|\-\-\-|\+\+\+|@generated SignedSource)" | grep "^[+-]" > /dev/null; then
333335
echo "Changes detected"
334336
echo "should_commit=true" >> "$GITHUB_OUTPUT"
335337
else

scripts/rollup/build-all-release-channels.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ function processStable(buildDir) {
168168
);
169169
}
170170

171+
if (fs.existsSync(buildDir + '/facebook-react-native')) {
172+
const versionString =
173+
ReactVersion + '-native-fb-' + sha + '-' + dateString;
174+
updatePlaceholderReactVersionInCompiledArtifacts(
175+
buildDir + '/facebook-react-native',
176+
versionString
177+
);
178+
}
179+
171180
// Now do the semver ones
172181
const semverVersionsMap = new Map();
173182
for (const moduleName in stablePackages) {

0 commit comments

Comments
 (0)