Skip to content

Conversation

@Dragon1573
Copy link
Contributor

@SpecterShell SpecterShell merged commit 4b2a14a into SpecterShell:main Jun 25, 2025
@SpecterShell
Copy link
Owner

If PowerShell itself can access the GitHub API directly, it'd be better to use PowerShell only rather than relying on other commands to keep simplicity.

The GitHub CLI shares the same rate limit with the normal REST API: cli/cli#5381

@Dragon1573 Dragon1573 deleted the issues/34 branch June 25, 2025 14:09
@Dragon1573
Copy link
Contributor Author

The GitHub CLI shares the same rate limit with the normal REST API: cli/cli#5381

Since there's a pre-configured ${{ secrets.GITHUB_TOKEN }} in every GitHub-hosted runner, I think this gh.exe is also pre-configured as logged in. API requests with logged in state can have much higher limits.

Here's my current rate limit info:

22:24:51 D:\Repository 0ms pwsh
$ (gh api rate_limit --jq '.resources' | ConvertFrom-Json -AsHashtable).GetEnumerator() |
> ForEach-Object {
>   $RetVal = [pscustomobject]@{ Name = $_.Name }
>   foreach ($Prop in $_.Value.GetEnumerator()) {
>     if ($Prop.Name -eq "reset") {
>       Add-Member -InputObject $RetVal -Type NoteProperty -Name $Prop.Name `
>         -Value ([System.DateTimeOffset]::FromUnixTimeSeconds($Prop.Value).ToLocalTime())
>     } else {
>       Add-Member -InputObject $RetVal -Type NoteProperty -Name $Prop.Name -Value $Prop.Value
>     }
>   }
>   $RetVal
> } |
> Format-Table

Name                        limit remaining reset                      used
----                        ----- --------- -----                      ----
actions_runner_registration 10000     10000 2025/06/25 23:24:52 +08:00    0
audit_log                    1750      1750 2025/06/25 23:24:52 +08:00    0
audit_log_streaming            15        15 2025/06/25 23:24:52 +08:00    0
code_scanning_autofix          10        10 2025/06/25 22:25:52 +08:00    0
code_scanning_upload         5000      5000 2025/06/25 23:24:52 +08:00    0
code_search                    10        10 2025/06/25 22:25:52 +08:00    0
core                         5000      5000 2025/06/25 23:24:52 +08:00    0
dependency_sbom               100       100 2025/06/25 22:25:52 +08:00    0
dependency_snapshots          100       100 2025/06/25 22:25:52 +08:00    0
graphql                      5000      5000 2025/06/25 23:24:52 +08:00    0
integration_manifest         5000      5000 2025/06/25 23:24:52 +08:00    0
scim                        15000     15000 2025/06/25 23:24:52 +08:00    0
search                         30        30 2025/06/25 22:25:52 +08:00    0
source_import                 100       100 2025/06/25 22:25:52 +08:00    0

@Dragon1573
Copy link
Contributor Author

If PowerShell itself can access the GitHub API directly, it'd be better to use PowerShell only rather than relying on other commands to keep simplicity.

I notice there're "external" cmdlets in the script, such as Invoke-GitHubApi. Where are they? Also there's a special $this variable in the script, what is it? How can I enable auto-completion support for them in VSCode?

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.

[Package Request]: MichalTrojnara.osslsigncode

2 participants