<@UQX3ZNU12> another suggestion for the typing val...
# github-workflows-kt
v
@Piotr Krzemiński another suggestion for the typing validation action. I've seen you have a dedicated
verbose
input to print debug information. This is rather unusal and unhandy as you have to edit the workflow definition to leverage it. I'd suggest you instead remove the input and use the standard approach to react to the
ACTIONS_STEP_DEBUG
secret being set to
true
. Or at least make the default value for that input depending on the standard way. So the consumer can just decide at runtime whether the run should be with or without debug logging and iirc GHA now even has a
rerun with debug logging
option that does it automatically without the need to manually change the secrets on the repository. Here how
@actions/core
does it: For determining whether debug is enabled to influence some behavior (for example my wsl start scripts enable echoing if it is set)
Copy code
/**
 * Gets whether Actions Step Debug is on or not
 */
export function isDebug(): boolean {
  return process.env['RUNNER_DEBUG'] === '1'
}
For outputting debug logs (basically printing
::debug::The debug message
):
Copy code
/**
 * Writes debug message to user log
 * @param message debug message
 */
export function debug(message: string): void {
  issueCommand('debug', {}, message)
}

/**
 * Commands
 *
 * Command Format:
 *   ::name key=value,key=value::message
 *
 * Examples:
 *   ::warning::This is the message
 *   ::set-env name=MY_VAR::some value
 */
export function issueCommand(
  command: string,
  properties: CommandProperties,
  message: any
): void {
  const cmd = new Command(command, properties, message)
  process.stdout.write(cmd.toString() + os.EOL)
}
So in your case you probably wouldn't even need the
isDebug
logic, but simply prefixing your messages with
::debug::
should already be enough.
p
Wow, that's great, I didn't know about such convention and GH's feature :) will adapt to your hint: https://github.com/krzema12/github-actions-typing/issues/13
👌 1