mirror of
https://github.com/actions/labeler.git
synced 2025-12-15 06:27:13 +00:00
Bump actions/github to 2.2.0 to support GHES (#72)
* Bumping actions/github to 2.2.0 * Husky commit correct node modules
This commit is contained in:
16
node_modules/windows-release/index.js
generated
vendored
16
node_modules/windows-release/index.js
generated
vendored
@@ -26,13 +26,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}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user