Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exit code 5 on composer require/create-project command #11616

Merged
merged 1 commit into from
Sep 3, 2023

Conversation

vtsykun
Copy link
Contributor

@vtsykun vtsykun commented Sep 1, 2023

After #11362, CI builds may fail with status code 5 if the composer command require/create-project is used.
This PR fix this BC break and the command will fail if the user has explicitly specified the --audit flag

composer install --audit

@@ -402,7 +404,7 @@ public function run(): int
$repoSet->addRepository($repo);
}

return $auditor->audit($this->io, $repoSet, $packages, $this->auditFormat, true, $this->config->get('audit')['ignore'] ?? []) > 0 ? self::ERROR_AUDIT_FAILED : 0;
return $auditor->audit($this->io, $repoSet, $packages, $this->auditFormat, true, $this->config->get('audit')['ignore'] ?? []) > 0 && true === $this->errorOnAudit ? self::ERROR_AUDIT_FAILED : 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

true === is useless as $this->errorOnAudit is already a boolean

@Seldaek Seldaek added this to the 2.6 milestone Sep 3, 2023
@Seldaek Seldaek merged commit 90cbb14 into composer:main Sep 3, 2023
20 checks passed
@Seldaek
Copy link
Member

Seldaek commented Sep 3, 2023

Thanks, probably makes sense to do this only on request

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.

None yet

3 participants