Skip to content

Conversation

MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jul 2, 2025

Description

This pull request makes small adjustments to improve code clarity and ensure consistent handling of unused return values. Specifically, it updates two functions to explicitly discard the output of the Invoke-GitHubAPI command by assigning it to $null.

Changes to improve code clarity:

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@Copilot Copilot AI review requested due to automatic review settings July 2, 2025 08:35
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner July 2, 2025 08:35
@MariusStorhaug MariusStorhaug self-assigned this Jul 2, 2025
Copy link
Contributor

@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 suppresses the output of token revocation functions by explicitly discarding the return values from Invoke-GitHubAPI.

  • Assigns the result of Invoke-GitHubAPI to $null in two functions to prevent unintended output.
  • Ensures consistent handling of unused API call outputs across public and private modules.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/functions/public/Auth/Revoke-GitHubAccessToken.ps1 Discarded Invoke-GitHubAPI output by assigning it to $null.
src/functions/private/Apps/GitHub Apps/Revoke-GitHubAppInstallationAccessToken.ps1 Discarded Invoke-GitHubAPI output by assigning it to $null.
Comments suppressed due to low confidence (1)

src/functions/private/Apps/GitHub Apps/Revoke-GitHubAppInstallationAccessToken.ps1:39

  • Add a Pester test to verify that this function emits no output when revoking an access token, ensuring the suppression behavior is covered by tests.
            $null = Invoke-GitHubAPI @InputObject

@MariusStorhaug MariusStorhaug merged commit 8e7b3d6 into main Jul 2, 2025
11 checks passed
@MariusStorhaug MariusStorhaug deleted the fixRevoke branch July 2, 2025 10:03
@github-project-automation github-project-automation bot moved this from Todo to Done in GitHub PowerShell Module Jul 2, 2025
Copy link
Contributor

github-actions bot commented Jul 2, 2025

Module GitHub - 0.33.3 published to the PowerShell Gallery.

Copy link
Contributor

github-actions bot commented Jul 2, 2025

GitHub release for GitHub v0.33.3 has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant