-
-
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
[bfix] Calculates and logs rate-limit #8
base: main
Are you sure you want to change the base?
Conversation
index.js
Outdated
const getRateLimit = await rateLimit(); | ||
console.log(getRateLimit.data.rate); | ||
const writeOSSF = async () => { | ||
repoOSSF[repository] = await output.slice(17).replace('\n', ''); |
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.
what's the magic 17 for?
also, this only replaces one newline; is that intended?
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.
The 17 slices the output string to get the Aggregate Score
value for each repo from it. And similarly replacing the newlines iteratively is needed to get the score properly
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.
It might be clearer to use the actual string with .length
rather than 17 :-)
Sounds good on the newlines - probably some text fixtures would make this clearer also.
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 did not understand, how can we splice the output string with .length
?
I'm not sure why the |
Try |
@Riyabelle25 i rebased this but there's basically nothing left in it. Could you repurpose it to continue the rate limiting work? |
@ljharb apologies for the long gap of silence. Had end of term examinations followed by a long period of bothersome illness 😞 |
Solves #5
Calculates and logs Rate-Limit using the GitHub API, making use of async-await