The CI environment variable is not set in GitHub Actions
See original GitHub issueDescribe the bug
The CI environment variable is not set in GitHub Actions. A lot of software relies on that to detect whether it’s running in CI. Example: https://github.com/jruby/jruby/issues/6113#issuecomment-596196601
Area for Triage:
Question, Bug, or Feature?: Feature
Virtual environments affected
- macOS 10.15
- Ubuntu 16.04 LTS
- Ubuntu 18.04 LTS
- Windows Server 2016 R2
- Windows Server 2019
Expected behavior
The environment variable CI should be set to true
, as it is in most CI solutions out there (e.g., TravisCI).
Actual behavior It’s not set: https://github.com/ruby/setup-ruby/runs/493307400?check_suite_focus=true
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Variables - GitHub Docs
Because default environment variables are set by GitHub and not defined in a workflow, they are not accessible through the env context. However,...
Read more >Environment variable in GitHub Actions not interpolated ...
It is not supported at the moment, to have env variable inside env. The docs on env mentions it: variables in the env...
Read more >GitHub Action fails with "The GITHUB_TOKEN environment ...
GitHub Action fails with “The GITHUB_TOKEN environment variable was not set”. This post was most recently updated on August 31st, 2022.
Read more >How to use GitHub Actions environment variables
This hands-on article discusses the environment variables available within GitHub Actions and when we should use them.
Read more >Recommended ways to catch missing environment ...
The application was deployed with a GitHub action. ... The environment variable was simply not set in GitHub's secrets. This was not caught ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
GitHub action is not only a CI system, the workflow run can be triggered on any GitHub event, like Issue create/comment, so I am not sure setting
CI=true
is appropriate for those scenarios. 😄@chrispat to comment on this.
shipped as part of the 2.168.0 runner.