Skip to content

Commit 0730d90

Browse files
authored
Merge pull request #14 from PRODYNA/feature/4-list-of-external-collaborators
Update templates
2 parents 235ebf4 + bca778e commit 0730d90

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ inputs:
2525
default: 1
2626
runs:
2727
using: 'docker'
28-
image: 'docker://ghcr.io/prodyna/github-users:v1.0'
28+
image: 'docker://ghcr.io/prodyna/github-users:v1.1'
2929
env:
3030
ACTION: ${{ inputs.action }}
3131
ENTERPRISE: ${{ inputs.enterprise }}

template/collaborators.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Last updated: {{ .Updated }}
44

55
| Number | User | Contributions | Organization | Repository |
66
| ------ | ---- | ------------- | ------------ | ---------- |
7-
{{ range $user := .Users }}{{ range $org := $user.Organizations }}{{ range $repo := $org.Repositories }}| {{ $user.Number }} | {{ $user.Login }} | {{ $user.Contributions }} | {{ $org.Name }} | {{ $repo.Name }} |
7+
{{ range $user := .Users }}{{ range $org := $user.Organizations }}{{ range $repo := $org.Repositories }}| {{ $user.Number }} | [{{ $user.Login }}](https://github.com/{{ $user.Login }}) | {{if $user.Contributions}}:green_square:{{else}}:red_square:{{end}} {{ $user.Contributions }} | [{{ $org.Name }}](https://github.com/{{ $org.Login }}) | [{{ $repo.Name }}](https://github.com/{{ $org.Login }}/{{ $repo.Name }}) |
88
{{ end }}{{ end }}{{ end }}
99

1010
---

template/members.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Last updated: {{ .Updated }}
44

55
| # | GitHub Login | GitHub name | E-Mail | Contributions |
66
| --- | --- | --- | --- | --- |
7-
{{ range .Users }} | {{ .Number }} | [{{ .Login }}](https://github.com/enterprises/{{ $.Enterprise.Slug }}/people/{{ .Login }}/sso) | {{ .Name }} | {{ .Email }} | {{if .Contributions}}:green_square:{{else}}:red_square:{{end}} [{{.Contributions }}](https://github.com/{{ .Name }}) |
7+
{{ range .Users }} | {{ .Number }} | [{{ .Login }}](https://github.com/enterprises/{{ $.Enterprise.Slug }}/people/{{ .Login }}/sso) | {{ .Name }} | {{ .Email }} | {{if .Contributions}}:green_square:{{else}}:red_square:{{end}} [{{.Contributions }}](https://github.com/{{ .Login }}) |
88
{{ end }}
99

1010
{{ if .Users }}_{{ len .Users }} users_{{ else }}No users found.{{ end }}

userlist/collaborators.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func (c *UserListConfig) loadCollaborators() error {
9999
slog.Info("Loading repositories and external collaborators", "organization", org.Login)
100100
var query struct {
101101
Organization struct {
102+
Login string
102103
Repositories struct {
103104
Nodes []struct {
104105
Name string
@@ -150,6 +151,7 @@ func (c *UserListConfig) loadCollaborators() error {
150151
slog.Info("Found existing user", "login", user.Login)
151152
}
152153
organization := Organization{
154+
Login: org.Login,
153155
Name: org.Name,
154156
Repositories: new([]Repository),
155157
}

userlist/userlist.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type User struct {
4848
}
4949

5050
type Organization struct {
51+
Login string `json:"Login"`
5152
Name string `json:"Name"`
5253
Repositories *[]Repository `json:"Repositories"`
5354
}

0 commit comments

Comments
 (0)