Skip to content

Commit 821944d

Browse files
rostalancursoragent
andcommitted
chore(ci): make main metadata validation non-blocking
Allow publish runs targeting main to continue when metadata validation reports errors so testing can proceed while still surfacing the validation result in the PR comment. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fa47d52 commit 821944d

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/auto-publish-pr.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ jobs:
279279
- prepare
280280
- check-up-to-date
281281
- detect-changes
282+
continue-on-error: ${{ needs.prepare.outputs.target-branch == 'main' }}
282283
if: |
283284
always() &&
284285
needs.prepare.result == 'success' &&
@@ -371,6 +372,8 @@ jobs:
371372
const onlyMetadataChanged = core.getInput('only_metadata_changed') === 'true';
372373
const targetBranch = core.getInput('target_branch');
373374
const skipMetadataValidationForTesting = targetBranch === 'main';
375+
const publishedExports = core.getMultilineInput('published_exports');
376+
const failedExports = core.getMultilineInput('failed_exports');
374377
const checkUpToDateResult = core.getInput('check_up_to_date_result');
375378
const exportResult = core.getInput('export_result');
376379
const checkBackstageCompatibilityResult = core.getInput('check_backstage_compatibility_result');
@@ -392,8 +395,10 @@ jobs:
392395
(detectResult === 'success' || detectResult === 'skipped');
393396
publishSuccess = false;
394397
} else {
395-
publishSuccess = exportResult === 'success';
396-
success = publishSuccess && checkBackstageCompatibilityResult === 'success';
398+
publishSuccess = exportResult === 'success' ||
399+
(skipMetadataValidationForTesting && publishedExports.length > 0);
400+
success = publishSuccess &&
401+
(skipMetadataValidationForTesting || checkBackstageCompatibilityResult === 'success');
397402
}
398403
399404
await github.rest.repos.createCommitStatus({
@@ -414,8 +419,6 @@ jobs:
414419
} else {
415420
body = `[Publish workflow](${workflowRun.data.html_url}) has completed with ${ publishSuccess ? 'success' : 'failure' }.`;
416421
417-
const publishedExports = core.getMultilineInput('published_exports');
418-
const failedExports = core.getMultilineInput('failed_exports');
419422
if (publishedExports.length + failedExports.length > 0) {
420423
if (failedExports.length > 0) {
421424
body += '\n\n#### Publishing process\n';
@@ -446,7 +449,11 @@ jobs:
446449
const metadataValidationErrorsJson = core.getInput('metadata_validation_errors');
447450
448451
if (skipMetadataValidationForTesting) {
449-
body += '\n\n#### Metadata Validation\n⚠️ Skipped on `main` for testing.';
452+
if (metadataValidationErrorCount && metadataValidationErrorCount !== '0') {
453+
body += '\n\n#### Metadata Validation\n⚠️ Validation errors detected on `main`, but they are non-blocking for testing.';
454+
} else {
455+
body += '\n\n#### Metadata Validation\n⚠️ Skipped on `main` for testing.';
456+
}
450457
} else if (metadataValidationPassed === 'true') {
451458
body += '\n\n#### Metadata Validation\n✅ All metadata files validated successfully.';
452459
} else if (metadataValidationErrorCount && metadataValidationErrorCount !== '0') {

0 commit comments

Comments
 (0)