Skip to content

Add flag to return a non-zero exit code if there are mismatched project references#21

Merged
Bessonov merged 1 commit intoBessonov:masterfrom
xpdota:exit-code-flag
Mar 1, 2026
Merged

Add flag to return a non-zero exit code if there are mismatched project references#21
Bessonov merged 1 commit intoBessonov:masterfrom
xpdota:exit-code-flag

Conversation

@xpdota
Copy link
Copy Markdown
Contributor

@xpdota xpdota commented Feb 27, 2026

The intent here is to make it easier to create a GH pipeline that uses set-project-references to block PRs from being merged if they contain mismatched project references, without trying to fix the mismatched references.

Also fixes the eslint issue on line 7.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a CLI flag to make set-project-references return a non-zero exit code when it detects mismatched TypeScript project references, enabling CI pipelines to fail on discrepancies without auto-fixing them. It also includes a small lint-related import formatting change.

Changes:

  • Add --use-exit-code flag and set process.exitCode = 1 when discrepancies are found.
  • Extend SetProjectReferencesOptions with a useExitCode field.
  • Adjust lodash import formatting to satisfy ESLint’s multiline trailing-comma rule.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/index.ts Adds CLI option and sets non-zero exit code on detected discrepancies; includes minor lint formatting change.
src/common/SetProjectReferencesOptions.ts Adds useExitCode to the options interface used by the CLI action.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts Outdated
Comment thread src/index.ts
Comment thread src/common/SetProjectReferencesOptions.ts
@Bessonov Bessonov assigned xpdota and unassigned Bessonov Mar 1, 2026
@Bessonov Bessonov merged commit c15cc6c into Bessonov:master Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants