Skip to content

Commit

Permalink
Merge branch 'release/1.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Apr 7, 2020
2 parents 9af89f7 + fb64e86 commit ce01ade
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 312 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [1.1.3] - 2020-04-07
### Changed
* Update dependencies

## [1.1.2] - 2020-04-03
### Changed
* Update dependencies
Expand Down Expand Up @@ -39,7 +43,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
### Added
* Execute comment

[Unreleased]: https://github.com/nwtgck/actions-comment-run/compare/v1.1.2...HEAD
[Unreleased]: https://github.com/nwtgck/actions-comment-run/compare/v1.1.3...HEAD
[1.1.3]: https://github.com/nwtgck/actions-comment-run/compare/v1.1.2...v1.1.3
[1.1.2]: https://github.com/nwtgck/actions-comment-run/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/nwtgck/actions-comment-run/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/nwtgck/actions-comment-run/compare/v1.0.3...v1.1.0
Expand Down
17 changes: 13 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,13 +802,21 @@ const windowsRelease = release => {

const ver = (version || [])[0];

// Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
// Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
// If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
// then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
// If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
// If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
// If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
const year = (stdout.match(/2008|2012|2016/) || [])[0];
let stdout;
try {
stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
} catch (_) {
stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
}

const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];

if (year) {
return `Server ${year}`;
}
Expand Down Expand Up @@ -11834,6 +11842,7 @@ var HttpCodes;
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
Expand Down
Loading

0 comments on commit ce01ade

Please # to comment.