-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action to fetch repo data for publishing to the blog #3
base: main
Are you sure you want to change the base?
Conversation
{ "date": "2021-08-11T01:02:49.166Z", "files": [ { "name": "src/data/repo-data.json", "deltaBytes": 106, "source": "https://api.github.com/graphql" } ] }
{ "date": "2021-08-11T01:27:24.536Z", "files": [ { "name": "repo-data-response.json", "deltaBytes": 102, "source": "https://api.github.com/graphql" } ] }
{ "date": "2021-08-11T01:33:23.386Z", "files": [ { "name": "repo-data-response.json", "deltaBytes": 994, "source": "https://api.github.com/graphql" } ] }
{ "date": "2021-08-12T01:55:25.200Z", "files": [ { "name": "src/data/repo-data-response.json", "deltaBytes": 4841, "source": "https://api.github.com/graphql" } ] }
{ "date": "2021-08-12T01:57:59.047Z", "files": [ { "name": "src/data/repo-data.json", "deltaBytes": 4726, "source": "https://api.github.com/graphql" } ] }
{ "date": "2021-08-12T04:26:48.863Z", "files": [ { "name": "src/data/repoData.json", "deltaBytes": -2148, "source": "https://api.github.com/graphql" } ] }
@elisechant this is now ready to review.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks useful. I like how this creates information about community activity.
I assume there's no data at the moment, as there is no activity on that repo yet?
Regarding screenshot below, I propose moving "View All Posts" higher to posts, or creating more space above "Recent contributor...".
Also, perhaps we add a title above posts "Recent posts" in the same weight as "Recent contributor..."? 🎨
@@ -0,0 +1,6 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we format this file at all?
let response; | ||
|
||
try { | ||
json = await Deno.readFile("src/data/repoData.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an advantage to using Deno here?
uses: githubocto/flat@v3 | ||
with: | ||
http_url: https://api.github.com/graphql | ||
downloaded_filename: src/data/repoData.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose renaming this to repo.json
try { | ||
await Deno.writeFile( | ||
"src/data/repoData.json", | ||
encoder.encode(JSON.stringify(response.data.repository)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional, but for it to remain clear that this file is generated, you could prepend a comment at the top of file? maybe it would also include the generated date.
</li> | ||
{% endfor %} | ||
</ul> | ||
<p><a href="">View all open issues</a></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing an href value here and in corresponding one below.
<div class="contributor-activity__wrapper"> | ||
<h4 class="au-display-md">Latest issue updates</h4> | ||
<ul class="contributor-activity__list"> | ||
{% for issue in repoData.issues.nodes %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this list need limiting?
This workflow action takes advantage of the Flat Data project to fetch data on a schedule so that it can be incorporated into the blog site's content.
Todo
push
events./src/data/repo-data.json