-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathGet-GitHubOidcSubjectClaimForRepository.ps1
More file actions
58 lines (48 loc) · 1.92 KB
/
Copy pathGet-GitHubOidcSubjectClaimForRepository.ps1
File metadata and controls
58 lines (48 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
function Get-GitHubOidcSubjectClaimForRepository {
<#
.SYNOPSIS
Get the customization template for an OIDC subject claim for a repository
.DESCRIPTION
Gets the customization template for an OpenID Connect (OIDC) subject claim for a repository.
.EXAMPLE
```powershell
Get-GitHubOidcSubjectClaimForRepository -Owner 'PSModule' -Repository 'GitHub' -Context $GitHubContext
```
Gets the OIDC subject claim customization template for the 'GitHub' repository.
.NOTES
[Get the customization template for an OIDC subject claim for a repository](https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository)
#>
[OutputType([pscustomobject])]
[CmdletBinding()]
param(
# The account owner of the repository. The name is not case sensitive.
[Parameter(Mandatory)]
[string] $Owner,
# The name of the repository without the .git extension. The name is not case sensitive.
[Parameter(Mandatory)]
[string] $Repository,
# The context to run the command in. Used to get the details for the API call.
# Can be either a string or a GitHubContext object.
[Parameter(Mandatory)]
[object] $Context
)
begin {
$stackPath = Get-PSCallStackPath
Write-Debug "[$stackPath] - Start"
Assert-GitHubContext -Context $Context -AuthType IAT, PAT, UAT
# Required permissions: Actions repo (read) or repo
}
process {
$apiParams = @{
Method = 'GET'
APIEndpoint = "/repos/$Owner/$Repository/actions/oidc/customization/sub"
Context = $Context
}
Invoke-GitHubAPI @apiParams | ForEach-Object {
Write-Output $_.Response
}
}
end {
Write-Debug "[$stackPath] - End"
}
}