GitTools / GitReleaseManager

Tool for creating and exporting releases for software applications hosted on GitHub
https://gittools.github.io/GitReleaseManager/docs/
MIT License
298 stars 39 forks source link

(#439) Add option to disable warning to stderr #576

Closed AdmiringWorm closed 4 months ago

AdmiringWorm commented 4 months ago

Description

This updates the handling of how we output log messages to the console to instead of blindly outputting warning messages to stderr all the time, it will instead check if an environment variable called CI is available and set to true, or the user themself have specified the --ci argument.

When CI system is detected, any warnings will instead be outputted to the normal stdout along with normal informational messages.

Related Issue

fixes #439

Motivation and Context

Certain CI systems out there will abort the build every time something is written to stderr. This causes problems on these systems when GitReleaseManager is ran.

How Has This Been Tested?

  1. On a repository, create a milestone with a valid version and one that does not contain any versions.
  2. Run grm create 2>files.txt with the appropriate arguments for the valid version, and ensure no warnings is displayed in the console.
  3. Open files.txt and ensure the warnings are located in the file (A warning about the invalid version should be in the file).
  4. Delete files.txt, and run grm create --ci 2>files.txt with the appropriate arguments for the valid version, and ensure the warnings is now displayed in the console.
  5. Open files.txt and ensure the warnings of the invalid version is not located in the file.

Screenshots (if appropriate):

Checklist:

gep13 commented 4 months ago

@AdmiringWorm I have just taken this for a spin, and the changes look good to me!

Thanks for getting this fixed up!