Skip to content

🪲 [Fix]: Fix debug and verbose inputs #61

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

Merged
merged 3 commits into from
Jul 1, 2025
Merged

🪲 [Fix]: Fix debug and verbose inputs #61

merged 3 commits into from
Jul 1, 2025

Conversation

MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jul 1, 2025

This pull request introduces updates to improve debug and verbose output handling across the GitHub PowerShell-based action. The changes ensure consistent configuration of debug and verbose preferences and enhance clarity in documentation and workflow files.

Debug and Verbose Output Handling Updates:

  • .github/workflows/TestWorkflow.yml: Added the -Debug parameter to the Get-GitHubUser command to enable debug output during the workflow execution.
  • action.yml: Updated the descriptions for Debug and Verbose inputs to clarify that they enable debug and verbose output for the entire action. Additionally, configured $DebugPreference and $VerbosePreference based on input values to set PowerShell preferences dynamically. [1] [2]
  • scripts/info.ps1: Removed redundant $DebugPreference and $VerbosePreference configuration from the end block, as these preferences are now set globally in the action runner.
  • scripts/outputs.ps1: Removed hardcoded $DebugPreference and $VerbosePreference settings to align with the new dynamic configuration approach.

Documentation Updates:

  • README.md: Improved descriptions for Debug and Verbose inputs to specify that they enable output for the entire action, enhancing clarity for users.

@MariusStorhaug MariusStorhaug self-assigned this Jul 1, 2025
@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 20:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR centralizes debug/verbose settings by removing hardcoded preferences from scripts and enabling dynamic configuration via action inputs, plus adds a debug flag to the GitHub user lookup in the test workflow.

  • Removed redundant $DebugPreference and $VerbosePreference settings in outputs.ps1 and info.ps1
  • Added dynamic Debug/Verbose preferences in action.yml based on inputs
  • Updated .github/workflows/TestWorkflow.yml to call Get-GitHubUser with -Debug

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
scripts/outputs.ps1 Removed hardcoded Debug/VerbosePreference settings
scripts/info.ps1 Removed redundant Debug/VerbosePreference settings in end
action.yml Added dynamic DebugPreference and VerbosePreference setup
.github/workflows/TestWorkflow.yml Added -Debug flag to Get-GitHubUser for enhanced output
Comments suppressed due to low confidence (3)

.github/workflows/TestWorkflow.yml:412

  • Piping the output of Get-GitHubUser -Debug into Format-Table will only format object output; debug messages go to the Debug stream and won’t be captured. To include debug messages in the log, redirect the Debug stream into the success stream (e.g., Get-GitHubUser -Debug 4>&1 | Format-Table -AutoSize | Out-String).
              Get-GitHubUser -Debug | Format-Table -AutoSize | Out-String

action.yml:95

  • Ensure that Debug and Verbose inputs are declared under the inputs: section in action.yml so that these environment variables are properly set and validated.
        $DebugPreference = $env:PSMODULE_GITHUB_SCRIPT_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue'

action.yml:95

  • [nitpick] Add documentation for the new Debug and Verbose inputs (descriptions and default values) in action.yml to clarify how to enable or suppress debug/verbose messages.
        $DebugPreference = $env:PSMODULE_GITHUB_SCRIPT_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue'

@MariusStorhaug MariusStorhaug merged commit cc12067 into main Jul 1, 2025
65 checks passed
@MariusStorhaug MariusStorhaug deleted the debug branch July 1, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant