@@ -171,7 +171,7 @@ jobs:
171
171
172
172
commit_www_artifacts :
173
173
needs : download_artifacts
174
- if : ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0') || github.ref == 'refs/heads/meta-www' }}
174
+ if : inputs.force == true || (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0')
175
175
runs-on : ubuntu-latest
176
176
steps :
177
177
- uses : actions/checkout@v4
@@ -201,7 +201,7 @@ jobs:
201
201
grep -rl "$CURRENT_VERSION_MODERN" ./compiled | xargs -r sed -i -e "s/$CURRENT_VERSION_MODERN/$LAST_VERSION_MODERN/g"
202
202
grep -rl "$CURRENT_VERSION_MODERN" ./compiled || echo "Modern version reverted"
203
203
- name : Check for changes
204
- if : ! inputs.force
204
+ if : inputs.force != true
205
205
id : check_should_commit
206
206
run : |
207
207
echo "Full git status"
@@ -219,7 +219,7 @@ jobs:
219
219
echo "should_commit=false" >> "$GITHUB_OUTPUT"
220
220
fi
221
221
- name : Re-apply version changes
222
- if : inputs.force || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_classic != '' && needs.download_artifacts.outputs.last_version_modern != '')
222
+ if : inputs.force == true || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_classic != '' && needs.download_artifacts.outputs.last_version_modern != '')
223
223
env :
224
224
CURRENT_VERSION_CLASSIC : ${{ needs.download_artifacts.outputs.current_version_classic }}
225
225
CURRENT_VERSION_MODERN : ${{ needs.download_artifacts.outputs.current_version_modern }}
@@ -236,12 +236,12 @@ jobs:
236
236
grep -rl "$LAST_VERSION_MODERN" ./compiled | xargs -r sed -i -e "s/$LAST_VERSION_MODERN/$CURRENT_VERSION_MODERN/g"
237
237
grep -rl "$LAST_VERSION_MODERN" ./compiled || echo "Classic version re-applied"
238
238
- name : Will commit these changes
239
- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
239
+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
240
240
run : |
241
241
echo ":"
242
242
git status -u
243
243
- name : Commit changes to branch
244
- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
244
+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
245
245
uses : stefanzweifel/git-auto-commit-action@v4
246
246
with :
247
247
commit_message : |
@@ -255,7 +255,7 @@ jobs:
255
255
256
256
commit_fbsource_artifacts :
257
257
needs : download_artifacts
258
- if : ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0') || github.ref == 'refs/heads/meta-fbsource' }}
258
+ if : inputs.force == true || (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0')
259
259
runs-on : ubuntu-latest
260
260
steps :
261
261
- uses : actions/checkout@v4
@@ -278,7 +278,7 @@ jobs:
278
278
grep -rl "$CURRENT_VERSION" ./compiled-rn | xargs -r sed -i -e "s/$CURRENT_VERSION/$LAST_VERSION/g"
279
279
grep -rl "$CURRENT_VERSION" ./compiled-rn || echo "Version reverted"
280
280
- name : Check for changes
281
- if : ! inputs.force
281
+ if : inputs.force != 'true'
282
282
id : check_should_commit
283
283
run : |
284
284
echo "Full git status"
@@ -297,7 +297,7 @@ jobs:
297
297
echo "should_commit=false" >> "$GITHUB_OUTPUT"
298
298
fi
299
299
- name : Re-apply version changes
300
- if : inputs.force || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_rn != '')
300
+ if : inputs.force == true || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_rn != '')
301
301
env :
302
302
CURRENT_VERSION : ${{ needs.download_artifacts.outputs.current_version_rn }}
303
303
LAST_VERSION : ${{ needs.download_artifacts.outputs.last_version_rn }}
@@ -307,12 +307,12 @@ jobs:
307
307
grep -rl "$LAST_VERSION" ./compiled-rn | xargs -r sed -i -e "s/$LAST_VERSION/$CURRENT_VERSION/g"
308
308
grep -rl "$LAST_VERSION" ./compiled-rn || echo "Version re-applied"
309
309
- name : Add files for signing
310
- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
310
+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
311
311
run : |
312
312
echo ":"
313
313
git add .
314
314
- name : Signing files
315
- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
315
+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
316
316
uses : actions/github-script@v7
317
317
with :
318
318
script : |
@@ -366,8 +366,9 @@ jobs:
366
366
console.log('Signing files in directory:', directory);
367
367
try {
368
368
const result = execSync(`git status --porcelain ${directory}`, {encoding: 'utf8'});
369
+ console.log(result);
369
370
370
- // Parse the git status output to get file paths
371
+ // Parse the git status output to get file paths!
371
372
const files = result.split('\n').filter(file => file.endsWith('.js'));
372
373
373
374
if (files.length === 0) {
@@ -376,7 +377,14 @@ jobs:
376
377
);
377
378
} else {
378
379
files.forEach(line => {
379
- const file = line.slice(3).trim();
380
+ let file = null;
381
+ if (line.startsWith('D ')) {
382
+ return;
383
+ } else if (line.startsWith('R ')) {
384
+ file = line.slice(line.indexOf('->') + 3);
385
+ } else {
386
+ file = line.slice(3).trim();
387
+ }
380
388
if (file) {
381
389
console.log(' Signing file:', file);
382
390
const originalContents = fs.readFileSync(file, 'utf8');
@@ -395,12 +403,12 @@ jobs:
395
403
console.error('Error signing files:', e);
396
404
}
397
405
- name : Will commit these changes
398
- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
406
+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
399
407
run : |
400
408
git add .
401
409
git status
402
410
- name : Commit changes to branch
403
- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
411
+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
404
412
uses : stefanzweifel/git-auto-commit-action@v4
405
413
with :
406
414
commit_message : |
0 commit comments