From 8e7b3d6860add74213a28ae3f0f53aef71c7c90c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 2 Jul 2025 12:03:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=B2=20[Fix]:=20Suppress=20output=20of?= =?UTF-8?q?=20functions=20for=20revoking=20access=20tokens=20(#452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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: * [`src/functions/private/Apps/GitHub Apps/Revoke-GitHubAppInstallationAccessToken.ps1`](diffhunk://#diff-fd0c42ecf8245c045d9e3798af80e494cd944a2e8ba180bf5719f381f517f689L39-R39): Updated the `Revoke-GitHubAppInstallationAccessToken` function to assign the return value of `Invoke-GitHubAPI` to `$null`, ensuring unused output is explicitly discarded. * [`src/functions/public/Auth/Revoke-GitHubAccessToken.ps1`](diffhunk://#diff-9be3d5b3b006ef480e23f78ee1fa7cb03d19f8973cc39eab75c452e8f59c3730L47-R47): Updated the `Revoke-GitHubAccessToken` function to assign the return value of `Invoke-GitHubAPI` to `$null`, maintaining consistency in handling unused outputs. ## Type of change - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- .../GitHub Apps/Revoke-GitHubAppInstallationAccessToken.ps1 | 2 +- src/functions/public/Auth/Revoke-GitHubAccessToken.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions/private/Apps/GitHub Apps/Revoke-GitHubAppInstallationAccessToken.ps1 b/src/functions/private/Apps/GitHub Apps/Revoke-GitHubAppInstallationAccessToken.ps1 index 99a5cf3b1..a5f6864d6 100644 --- a/src/functions/private/Apps/GitHub Apps/Revoke-GitHubAppInstallationAccessToken.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Revoke-GitHubAppInstallationAccessToken.ps1 @@ -36,7 +36,7 @@ function Revoke-GitHubAppInstallationAccessToken { } if ($PSCmdlet.ShouldProcess('GitHub App installation access token', 'Revoke')) { - Invoke-GitHubAPI @InputObject + $null = Invoke-GitHubAPI @InputObject } } diff --git a/src/functions/public/Auth/Revoke-GitHubAccessToken.ps1 b/src/functions/public/Auth/Revoke-GitHubAccessToken.ps1 index bfddcee90..67791fe8b 100644 --- a/src/functions/public/Auth/Revoke-GitHubAccessToken.ps1 +++ b/src/functions/public/Auth/Revoke-GitHubAccessToken.ps1 @@ -44,7 +44,7 @@ Anonymous = $true } if ($PSCmdlet.ShouldProcess('Tokens', 'Revoke')) { - Invoke-GitHubAPI @InputObject + $null = Invoke-GitHubAPI @InputObject } } Write-Debug "[$stackPath] - End"