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

After switching to PHP, the CI run is always successful, even when it should fail #19

Closed
leoloso opened this issue Jul 5, 2021 · 3 comments

Comments

@leoloso
Copy link

leoloso commented Jul 5, 2021

In this code in entrypoint.php:

exec($copyGitDirectoryCommandLine, $outputLines, $exitCode);

if ($exitCode === 1) {
    die('Command failed');
}

...the php die is only printing the message on screen, but it does not produce an exit 1, so the script still does not fail.

Demonstration:

I also tried executing this (https://github.com/leoloso/monorepo-split-github-action/blob/8795fc8/entrypoint.php#L98):

exec('exit ' . $exitCode);

But it also doesn't work.

@leoloso
Copy link
Author

leoloso commented Jul 5, 2021

I searched for documentation, but didn't find anything. The GitHub Action docs only explain how to exit from entrypoint.sh.

So I have no clue how to fix this.

@Ferror
Copy link
Contributor

Ferror commented Oct 10, 2022

Well there is an official js package..maybe we need something similar - https://github.com/actions/toolkit/tree/main/packages/core

@TomasVotruba
Copy link
Collaborator

This is rather generic Github Action issue, unrelated to this package.

If you find a better way, please send PR 👍

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

No branches or pull requests

3 participants