OndraM / ci-detector

Detect continuous integration environment and get information of current build
MIT License
212 stars 12 forks source link

No detect ci github-actions. #74

Closed terabytesoftw closed 4 years ago

terabytesoftw commented 4 years ago
Q A
Version 3.3.0
PHP version 7.4.7
CI github actions.
workflow https://github.com/yii-extension/app/actions/runs/134544425/workflow
issue https://github.com/infection/infection/issues/1272

No detect CI github-actions in testing muting infection.

OndraM commented 4 years ago

Hi, GitHub actions detection seems to be working as expected - here you can see dump of detected properties from actual Github Actions workflow: https://github.com/OndraM/ci-detector/runs/771770893?check_suite_focus=true#step:6:6

Isn't possible the env variables are not available in the script? You can try running "env" command in github workflow to see the actual environment variables.

OndraM commented 4 years ago

I investigated your workflow a bit more, and find the issue.

You are running infection using sudo. However when using sudo, GitHub Actions does not set required environment variables for the sudo shell, making CI detection impossible.

I suggest not to run commands via sudo in your workflow. Unfortunately, this is behavior of GH actions and there is nothing I can do about it, sorry.