Skip to content

Commit

Permalink
Merge pull request #14 from PRODYNA/feature/4-list-of-external-collab…
Browse files Browse the repository at this point in the history
…orators

Update templates
  • Loading branch information
dkrizic authored Mar 13, 2024
2 parents 235ebf4 + bca778e commit 0730d90
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion template/collaborators.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

---
Expand Down
2 changes: 1 addition & 1 deletion template/members.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions userlist/collaborators.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
}
Expand Down
1 change: 1 addition & 0 deletions userlist/userlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type User struct {
}

type Organization struct {
Login string `json:"Login"`
Name string `json:"Name"`
Repositories *[]Repository `json:"Repositories"`
}
Expand Down

0 comments on commit 0730d90

Please sign in to comment.