From 533746a645403b1b55db7e9101a6e08305de8cef Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Wed, 15 Jul 2020 14:27:38 +0200 Subject: [PATCH 1/3] Improved error output during setup --- README.md | 4 +++- dist/index.js | 3 +++ src/install-python.ts | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c33424c68..322a6cdf8 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,9 @@ You should specify only a major and minor version if you are okay with the most # Using `setup-python` with a self hosted runner -If you would like to use `setup-python` and a self-hosted runner, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner. +Python distributions are only available for the same [environments](https://github.com/actions/virtual-environments#available-environments) that GitHub Actions hosted environments are available for. If you are using an unsupported version of Ubuntu such as `19.04` or an alternative Linux distribution such as Fedora, `setup-python` will not work. If you have a supported `self-hosted` runner and you would like to use `setup-python`, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner. + +If you are experience problems while configuring python on your self-hosted runner. Turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see addition logs. ### Windows diff --git a/dist/index.js b/dist/index.js index d00652be1..5bd9c4fe4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6356,6 +6356,9 @@ function installPython(workingDirectory) { listeners: { stdout: (data) => { core.debug(data.toString().trim()); + }, + stderr: (data) => { + core.error(data.toString().trim()); } } }; diff --git a/src/install-python.ts b/src/install-python.ts index 3acbab106..a931a5a50 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -3,6 +3,7 @@ import * as core from '@actions/core'; import * as tc from '@actions/tool-cache'; import * as exec from '@actions/exec'; import {ExecOptions} from '@actions/exec/lib/interfaces'; +import {stderr} from 'process'; const TOKEN = core.getInput('token'); const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`; @@ -38,6 +39,9 @@ async function installPython(workingDirectory: string) { listeners: { stdout: (data: Buffer) => { core.debug(data.toString().trim()); + }, + stderr: (data: Buffer) => { + core.error(data.toString().trim()); } } }; From afa9f9fbc99ce02ce3919f136c4e74d1b8586bab Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Wed, 15 Jul 2020 18:30:20 +0200 Subject: [PATCH 2/3] Change from debug to info for normal output --- README.md | 2 +- dist/index.js | 2 +- src/install-python.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 322a6cdf8..a7877f19f 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ You should specify only a major and minor version if you are okay with the most Python distributions are only available for the same [environments](https://github.com/actions/virtual-environments#available-environments) that GitHub Actions hosted environments are available for. If you are using an unsupported version of Ubuntu such as `19.04` or an alternative Linux distribution such as Fedora, `setup-python` will not work. If you have a supported `self-hosted` runner and you would like to use `setup-python`, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner. -If you are experience problems while configuring python on your self-hosted runner. Turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see addition logs. +If you are experience problems while configuring python on your `self-hosted` runner. Turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see addition logs. ### Windows diff --git a/dist/index.js b/dist/index.js index 5bd9c4fe4..5b106e700 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6355,7 +6355,7 @@ function installPython(workingDirectory) { silent: true, listeners: { stdout: (data) => { - core.debug(data.toString().trim()); + core.info(data.toString().trim()); }, stderr: (data) => { core.error(data.toString().trim()); diff --git a/src/install-python.ts b/src/install-python.ts index a931a5a50..fb5ffc7d1 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -38,7 +38,7 @@ async function installPython(workingDirectory: string) { silent: true, listeners: { stdout: (data: Buffer) => { - core.debug(data.toString().trim()); + core.info(data.toString().trim()); }, stderr: (data: Buffer) => { core.error(data.toString().trim()); From 6fd8fd87af47c44c368b2cc2edf3b6738a712124 Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Wed, 15 Jul 2020 19:06:25 +0200 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7877f19f..52811fec5 100644 --- a/README.md +++ b/README.md @@ -136,9 +136,9 @@ You should specify only a major and minor version if you are okay with the most # Using `setup-python` with a self hosted runner -Python distributions are only available for the same [environments](https://github.com/actions/virtual-environments#available-environments) that GitHub Actions hosted environments are available for. If you are using an unsupported version of Ubuntu such as `19.04` or an alternative Linux distribution such as Fedora, `setup-python` will not work. If you have a supported `self-hosted` runner and you would like to use `setup-python`, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner. +Python distributions are only available for the same [environments](https://github.com/actions/virtual-environments#available-environments) that GitHub Actions hosted environments are available for. If you are using an unsupported version of Ubuntu such as `19.04` or another Linux distribution such as Fedora, `setup-python` will not work. If you have a supported self-hosted runner and you would like to use `setup-python`, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner. -If you are experience problems while configuring python on your `self-hosted` runner. Turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see addition logs. +If you are experiencing problems while configuring Python on your self-hosted runner, turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see addition logs. ### Windows