Skip to content

Commit

Permalink
Merge pull request #93 from multiformats/master-upgrade
Browse files Browse the repository at this point in the history
upgrade@7931539654
  • Loading branch information
galargh authored Feb 16, 2024
2 parents d2bd149 + 32a3b10 commit 0357706
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 10 additions & 3 deletions scripts/src/actions/shared/get-access-summary-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ function getAccessSummaryFrom(source: State | Config): Record<string, any> {
}

function describeAccessSummary(accessSummary: Record<string, any>): string {
const lines: string[] = []
const lines: string[] = [
'<details><summary>Access Summary</summary>',
'',
'```',
]

const permissions = ['admin', 'maintain', 'push', 'triage', 'pull']

for (const [username, summary] of Object.entries(accessSummary)) {
lines.push(`User @${username}:`)
lines.push(`User ${username}:`)
if (summary.role !== undefined) {
lines.push(` - is a ${summary.role} of the organization`)
} else {
Expand All @@ -69,7 +74,7 @@ function describeAccessSummary(accessSummary: Record<string, any>): string {
if (access.type === 'collaborator') {
buffer.push(` - ${repository} as a direct collaborator`)
} else {
buffer.push(` - ${repository} through team @${access.team}`)
buffer.push(` - ${repository} through team ${access.team}`)
}
}
}
Expand All @@ -86,6 +91,8 @@ function describeAccessSummary(accessSummary: Record<string, any>): string {
}
}

lines.push('```', '')

return lines.join('\n')
}

Expand Down
8 changes: 1 addition & 7 deletions terraform/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ resource "github_branch_protection" "this" {
]) : item.index => local.resources[item.source].github_branch_protection.this[item.index]
}

depends_on = [github_repository.this]

pattern = each.value.pattern

repository_id = try(each.value.repository_id, github_repository.this[lower(each.value.repository)].node_id)
Expand Down Expand Up @@ -239,7 +237,7 @@ resource "github_team_repository" "this" {
]) : item.index => local.resources[item.source].github_team_repository.this[item.index]
}

depends_on = [github_team.this, github_repository.this]
depends_on = [github_repository.this]

repository = each.value.repository
permission = each.value.permission
Expand All @@ -261,8 +259,6 @@ resource "github_team_membership" "this" {
] : item.index => local.resources[item.source].github_team_membership.this[item.index]
}

depends_on = [github_team.this]

username = each.value.username
role = each.value.role

Expand Down Expand Up @@ -292,8 +288,6 @@ resource "github_repository_file" "this" {
]) : item.index => local.resources[item.source].github_repository_file.this[item.index]
}

depends_on = [github_repository.this]

repository = each.value.repository
file = each.value.file
content = each.value.content
Expand Down

0 comments on commit 0357706

Please sign in to comment.