From bca778ee8064bfe914cbcf269129949d3e636eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darko=20Kri=C5=BEi=C4=87?= Date: Wed, 13 Mar 2024 13:36:36 +0100 Subject: [PATCH] Update templates --- action.yaml | 2 +- template/collaborators.tpl | 2 +- template/members.tpl | 2 +- userlist/collaborators.go | 2 ++ userlist/userlist.go | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/action.yaml b/action.yaml index 393b810..9686f03 100644 --- a/action.yaml +++ b/action.yaml @@ -25,7 +25,7 @@ inputs: default: 1 runs: using: 'docker' - image: 'docker://ghcr.io/prodyna/github-users:v1.0' + image: 'docker://ghcr.io/prodyna/github-users:v1.1' env: ACTION: ${{ inputs.action }} ENTERPRISE: ${{ inputs.enterprise }} diff --git a/template/collaborators.tpl b/template/collaborators.tpl index 9aec363..f141ca3 100644 --- a/template/collaborators.tpl +++ b/template/collaborators.tpl @@ -4,7 +4,7 @@ Last updated: {{ .Updated }} | Number | User | Contributions | Organization | Repository | | ------ | ---- | ------------- | ------------ | ---------- | -{{ range $user := .Users }}{{ range $org := $user.Organizations }}{{ range $repo := $org.Repositories }}| {{ $user.Number }} | {{ $user.Login }} | {{ $user.Contributions }} | {{ $org.Name }} | {{ $repo.Name }} | +{{ 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 }}) | {{ end }}{{ end }}{{ end }} --- diff --git a/template/members.tpl b/template/members.tpl index 8e30774..8f7e7ee 100644 --- a/template/members.tpl +++ b/template/members.tpl @@ -4,7 +4,7 @@ Last updated: {{ .Updated }} | # | GitHub Login | GitHub name | E-Mail | Contributions | | --- | --- | --- | --- | --- | -{{ 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 }}) | +{{ 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 }}) | {{ end }} {{ if .Users }}_{{ len .Users }} users_{{ else }}No users found.{{ end }} diff --git a/userlist/collaborators.go b/userlist/collaborators.go index 5cf479f..e6033dc 100644 --- a/userlist/collaborators.go +++ b/userlist/collaborators.go @@ -99,6 +99,7 @@ func (c *UserListConfig) loadCollaborators() error { slog.Info("Loading repositories and external collaborators", "organization", org.Login) var query struct { Organization struct { + Login string Repositories struct { Nodes []struct { Name string @@ -150,6 +151,7 @@ func (c *UserListConfig) loadCollaborators() error { slog.Info("Found existing user", "login", user.Login) } organization := Organization{ + Login: org.Login, Name: org.Name, Repositories: new([]Repository), } diff --git a/userlist/userlist.go b/userlist/userlist.go index 927b88e..969c9ba 100644 --- a/userlist/userlist.go +++ b/userlist/userlist.go @@ -48,6 +48,7 @@ type User struct { } type Organization struct { + Login string `json:"Login"` Name string `json:"Name"` Repositories *[]Repository `json:"Repositories"` }