用powershell實作,管理github自動化
搜索關鍵字如下:
PowerShellForGitHub powershell 傳教士 原創文章,始于 2021-02-04 允許轉載,但必須保留名字和出處,否則追究法律責任
---【簡介】---
PowerShellForGitHub是微軟開發的powershell庫,它通過github v3版api,訪問相關功能,以達到自動化的目的, 官網:https://github.com/microsoft/PowerShellForGitHub---【庫的功能串列】---
查詢,創建,更新和洗掉存盤庫,包括:查詢,創建和洗掉Branches以及關聯的分支保護規則,
查詢并創建新的Forks
在倉庫中查詢和創建內容,
查詢存盤庫中的語言和標簽,并查詢/更新其主題,
更改存盤庫所有權,
查詢,啟用和禁用安全和漏洞警報,
查詢并設定GitHub Actions權限,
查詢,設定和洗掉團隊權限,
查詢各種流量報告,包括引薦來源和路徑,頁面視圖和克隆, 查詢,創建,編輯,鎖定/解鎖問題及其所有相關屬性:
查詢,檢查,添加和洗掉受讓人
查詢,創建,編輯和洗掉問題注釋
查詢,創建,編輯和洗掉標簽
查詢事件和 時間表
查詢,創建,編輯和洗掉里程碑 查詢和創建拉取請求
查詢合作者
查詢貢獻者
查詢組織及其成員,
查詢和更新用戶
查詢,創建,編輯和洗掉Teams以及查詢其成員,
查詢,創建,編輯和洗掉Projects以及 Project Columns和 Project Cards
查詢,創建,編輯和洗掉發布以及相關的內容/資產,
查詢,創建,編輯,洗掉,分叉和取消(un)star gists以及要點注釋,
查詢,編輯和洗掉對“問題”和“拉取請求”的反應, 雜項功能:
獲取所有行為準則以及特定回購協議的行為準則,
獲取所有GitHub表情符號
獲取gitignore模板
獲取常用許可證以及特定存盤庫的許可證,
將markdown轉換為等效的HTML
獲取您當前使用API??的速率限制,
---【安裝】---
Install-Module -Name PowerShellForGitHub---【保存github賬戶密碼】---
在這里設定api token:https://github.com/settings/tokens/new 用這個命令,保存賬戶密碼:
Set-GitHubAuthentication 查看幫助:
Get-Help Set-GitHubAuthentication -Examples
---【例子:查找所有標簽為“需要進行復制的步驟”的問題,并為這些問題添加新的注釋】---
$issues = @(Get-GitHubIssue -OwnerName microsoft -RepositoryName PowerShellForGitHub -Label 'repro steps needed') foreach ($issue in $issues) { $params = @{ 'OwnerName' = 'microsoft' 'RepositoryName' = 'PowerShellForGitHub' 'Issue' = $issue.number 'Body' = 'Any update on those repro steps?' } New-GitHubIssueComment @params }
---【更多命令的用法和例子】---
https://github.com/microsoft/PowerShellForGitHub/blob/master/USAGE.md#examples
---【附錄a:命令串列】---
Add-GitHubAssigneeAdd-GitHubIssueLabel
Backup-GitHubConfiguration
Clear-GitHubAuthentication
ConvertFrom-GitHubMarkdown
Get-GitHubConfiguration
Get-GitHubEmoji
Get-GitHubRateLimit
Group-GitHubIssue
Group-GitHubPullRequest
Invoke-GHRestMethod
Invoke-GHRestMethodMultipleResult
Join-GitHubUri
New-GitHubTeam
Remove-GitHubAssignee
Remove-GitHubGistFile
Reset-GitHubConfiguration
Restore-GitHubConfiguration
Set-GitHubAuthentication
Set-GitHubConfiguration
Set-GitHubGistFile
Set-GitHubIssueLabel
Set-GitHubProfile
Set-GitHubRepositoryTopic
Test-GitHubAuthenticationConfigured
Add-GitHubGistStar
Copy-GitHubGist
Disable-GitHubRepositorySecurityFix
Disable-GitHubRepositoryVulnerabilityAlert
Enable-GitHubRepositorySecurityFix
Enable-GitHubRepositoryVulnerabilityAlert
Get-GitHubAssignee
Get-GitHubCloneTraffic
Get-GitHubCodeOfConduct
Get-GitHubContent
Get-GitHubEvent
Get-GitHubGist
Get-GitHubGistComment
Get-GitHubGitIgnore
Get-GitHubIssue
Get-GitHubIssueComment
Get-GitHubIssueTimeline
Get-GitHubLabel
Get-GitHubLicense
Get-GitHubMilestone
Get-GitHubOrganizationMember
Get-GitHubPathTraffic
Get-GitHubProject
Get-GitHubProjectCard
Get-GitHubProjectColumn
Get-GitHubPullRequest
Get-GitHubReaction
Get-GitHubReferrerTraffic
Get-GitHubRelease
Get-GitHubReleaseAsset
Get-GitHubRepository
Get-GitHubRepositoryActionsPermission
Get-GitHubRepositoryBranch
Get-GitHubRepositoryBranchProtectionRule
Get-GitHubRepositoryCollaborator
Get-GitHubRepositoryContributor
Get-GitHubRepositoryFork
Get-GitHubRepositoryLanguage
Get-GitHubRepositoryTag
Get-GitHubRepositoryTeamPermission
Get-GitHubRepositoryTopic
Get-GitHubTeam
Get-GitHubTeamMember
Get-GitHubUser
Get-GitHubUserContextualInformation
Get-GitHubViewTraffic
Initialize-GitHubLabel
Lock-GitHubIssue
Move-GitHubProjectCard
Move-GitHubProjectColumn
Move-GitHubRepositoryOwnership
New-GitHubGist
New-GitHubGistComment
New-GitHubIssue
New-GitHubIssueComment
New-GitHubLabel
New-GitHubMilestone
New-GitHubProject
New-GitHubProjectCard
New-GitHubProjectColumn
New-GitHubPullRequest
New-GitHubRelease
New-GitHubReleaseAsset
New-GitHubRepository
New-GitHubRepositoryBranch
New-GitHubRepositoryBranchProtectionRule
New-GitHubRepositoryFork
New-GitHubRepositoryFromTemplate
Remove-GitHubGist
Remove-GitHubGistComment
Remove-GitHubGistStar
Remove-GitHubIssueComment
Remove-GitHubIssueLabel
Remove-GitHubLabel
Remove-GitHubMilestone
Remove-GitHubProject
Remove-GitHubProjectCard
Remove-GitHubProjectColumn
Remove-GitHubReaction
Remove-GitHubRelease
Remove-GitHubReleaseAsset
Remove-GitHubRepository
Remove-GitHubRepositoryBranch
Remove-GitHubRepositoryBranchProtectionRule
Remove-GitHubRepositoryTeamPermission
Remove-GitHubTeam
Rename-GitHubGistFile
Rename-GitHubRepository
Rename-GitHubTeam
Set-GitHubContent
Set-GitHubGist
Set-GitHubGistComment
Set-GitHubGistStar
Set-GitHubIssue
Set-GitHubIssueComment
Set-GitHubLabel
Set-GitHubMilestone
Set-GitHubProject
Set-GitHubProjectCard
Set-GitHubProjectColumn
Set-GitHubReaction
Set-GitHubRelease
Set-GitHubReleaseAsset
Set-GitHubRepository
Set-GitHubRepositoryActionsPermission
Set-GitHubRepositoryTeamPermission
Set-GitHubTeam
Split-GitHubUri
Test-GitHubAssignee
Test-GitHubGistStar
Test-GitHubOrganizationMember
Test-GitHubRepositoryVulnerabilityAlert
Unlock-GitHubIssue
-完-
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/256672.html
標籤:其他
