Skip to content

Commit

Permalink
Improved logging during setup (#113)
Browse files Browse the repository at this point in the history
* Improved error output during setup

* Change from debug to info for normal output

* Apply suggestions from code review

Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>

Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
  • Loading branch information
konradpabjan and brcrista committed Jul 15, 2020
1 parent 654aa00 commit 7a69c2b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 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

Expand Down
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6355,7 +6355,10 @@ 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());
}
}
};
Expand Down
6 changes: 5 additions & 1 deletion src/install-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down Expand Up @@ -37,7 +38,10 @@ 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());
}
}
};
Expand Down

0 comments on commit 7a69c2b

Please sign in to comment.