Skip to content

Commit 41c19c5

Browse files
authored
Merge pull request #2 from PRODYNA/feature/1-add-updated-timestamp
Last updated feature
2 parents 82a8c94 + 8bb0335 commit 41c19c5

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
# Run the deployment overview action
4343
- name: Github users
44-
uses: prodyna/github-users@v0.3
44+
uses: prodyna/github-users@v0.4
4545
with:
4646
# The action to run
4747
action: userlist

template/userlist.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# GitHub Enterprise Users for {{ .Enterprise.Name }}
22

3+
Last updated: {{ .Updated }}
4+
35
| # | GitHub Login | E-Mail |
46
| --- | --- | --- |
57
{{ range .Users }} | {{ .Number }} | [{{ .Login }}](https://github.com/enterprises/{{ $.Enterprise.Slug }}/people/{{ .Login }}/sso) | {{ .Email }} |
68
{{end}}
9+
---
10+
Generated with :heart: by [github-users](https://github.com/prodyna/github-users)

userlist/userlist.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"log/slog"
1212
"os"
1313
"text/template"
14+
"time"
1415
)
1516

1617
type UserListConfig struct {
@@ -24,6 +25,7 @@ type UserListConfig struct {
2425
}
2526

2627
type UserList struct {
28+
Updated string
2729
Enterprise Enterprise
2830
Users []User
2931
}
@@ -111,7 +113,10 @@ func (c *UserListConfig) Load() error {
111113
return errors.New("Config not validated")
112114
}
113115
slog.Info("Loading userlist", "enterprise", c.enterprise)
114-
c.userList = &UserList{}
116+
c.userList = &UserList{
117+
// updated as RFC3339 string
118+
Updated: time.Now().Format(time.RFC3339),
119+
}
115120

116121
ctx := context.Background()
117122
src := oauth2.StaticTokenSource(

0 commit comments

Comments
 (0)