-
Notifications
You must be signed in to change notification settings - Fork 455
Automatically turn on debugging #264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@DanRigby @mjpieters now that debug actually does something, what are your thoughts on this? |
I kind-of like this idea, it makes sense. You can always use |
Something like this should work with the existing "Enable debug logging" option: const debug = core.getBooleanInput('debug') || core.isDebug() |
@mjpieters Is my reading correct that you meant that the default makes sense in line with the UI checkbox, and if someone wants a different 'static' behavior, they can use what you described. i.e. "You can" = "If someone wants". |
@joshmgross that wouldn't allow explicit |
Good point, we'd need to check if it's set first: const debugSpecified = core.getInput('debug') !== ''
const debug = debugSpecified ? core.getBooleanInput('debug') : core.isDebug() |
... and that implies changing the default to This looks like a viable -2+3 PR already :) |
|
Yep, that's what I'm thinking too...
... but there's a default right now: Lines 15 to 17 in 8d76c9a
and we need some default (e.g. |
However, you can use Github Action expressions as the default in |
Correction: default: ${{ (env.RUNNER_DEBUG == '1' && 'true') || 'false' }} |
I've confirmed locally (via https://github.com/nektos/act) that the above expression works as designed. |
Does runner_debug take the secrets into account? |
The Testing for the environment variable is also what |
Thanks for the PR @mjpieters, I was just about to create one :) |
Thanks for your efforts @mjpieters, it wasn't as trivial as it looked in the above conversation. |
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to debug a
script: |
block, and I have to modify the script withdebug: true
to be able to do so even though there's UI for it in shape of "[x] Enable debug logging".Describe the solution you'd like
Make the default value of
debug
paramgithub-script/action.yml
Lines 15 to 17 in 7a5c598
equivalent to
default: ${{ secrets.ACTIONS_STEP_DEBUG || false }}
. Not sure if this would work verbatum, but what would work best if it tries to read the secret, and if that fails or not set, then falls back to the now-defaultfalse
. I tried this as a parameter to the action, and it works well.Describe alternatives you've considered
Trying to remember to put
debug: ${{ secrets.ACTIONS_STEP_DEBUG || false }}
for all of my .yml files.Additional context
See TWiStErRob/github-actions-test#1 for the workaround.
Normal run without debugging: https://github.com/TWiStErRob/github-actions-test/runs/6740560658
Re-ran with Enable debug logging: https://github.com/TWiStErRob/github-actions-test/runs/6740567848
Note: ignore the fact that there's no output, reported that separately #265
The text was updated successfully, but these errors were encountered: