-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missed main func for GitHub Utils
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using GitHubUtils.Core; | ||
|
||
const string githubToken = "pat_token"; | ||
const string organizationName = "org_name"; | ||
const string teamName = "team_name"; | ||
const string repositoryPrefix = "repo_prefix"; | ||
|
||
var githubClient = new GitHubClientWrapper(githubToken); | ||
|
||
var team = await githubClient.GetTeam(organizationName, teamName); | ||
var filteredRepos = await githubClient.GetRepos(organizationName, | ||
r => r.Name.StartsWith(repositoryPrefix, StringComparison.OrdinalIgnoreCase)); | ||
|
||
foreach (var repo in filteredRepos) | ||
{ | ||
var request = new RepoAssignRequest(repo.Name, organizationName, [team.Id]); | ||
Check warning on line 16 in GitHubUtils/Program.cs GitHub Actions / build_and_test
|
||
var response = await githubClient.GrantAccessToRepository(request); | ||
Console.WriteLine("Access granted to: " + response.First().RepositoryName); | ||
} |