Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Since pulumi-github v5.9.1, parentTeamId is of type string (#3914)
Browse files Browse the repository at this point in the history
Since `pulumi-github` v5.9.1, `parentTeamId` is a string
  • Loading branch information
ringods authored Feb 7, 2024
1 parent 357e948 commit a585924
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions themes/default/content/blog/managing-github-with-pulumi/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ authors: ["guinevere-saenger"]
tags: ["go", "migration", "packages", "github-actions", "people-ops", "ci-cd"]
---

{{% notes type="info" %}}
We recently updated this article to reflect that `parentTeamId` of the `Team` resource accepts a `string` instead of an `int` since v5.9.1 of the
[Pulumi Github](/registry/packages/github/) package.
{{% /notes %}}

Ah, GitHub. The home of all developers. The place where we share code. The world’s most awkward social media site. The secret LinkedIn for techies. The tool we use for company org structure, work planning, code ownership, and permissions…

Wait.
Expand Down Expand Up @@ -278,15 +283,10 @@ func setupTeams(ctx *pulumi.Context, parentTeam *Team) error {
for _, childTeam := range parentTeam.Teams {
// set each child team's parent team ID to the current team ID
ghChildTeam, err := github.NewTeam(ctx, childTeam.Slug, &github.TeamArgs{
Description: pulumi.String(childTeam.Description),
Name: pulumi.String(childTeam.Name),
Privacy: pulumi.String("closed"),
ParentTeamId: ghParentTeam.ID().ApplyT(func(id interface{}) int {
// we need to re-cast id as an int so we can then transform it into a pulumi.IntOutput, which can be used to set the ParentTeamId.
x := fmt.Sprintf("%v", id)
y, _ := strconv.Atoi(x)
return y
}).(pulumi.IntOutput),
Description: pulumi.String(childTeam.Description),
Name: pulumi.String(childTeam.Name),
Privacy: pulumi.String("closed"),
ParentTeamId: ghParentTeam.ID(),
}, pulumi.Protect(false))
if err != nil {
fmt.Println("encountered error creating new Pulumi github team: ", childTeam.Name)
Expand Down

0 comments on commit a585924

Please sign in to comment.