Skip to content

Commit

Permalink
Merge branch 'main' into feat/232/refactor-ProposalCard
Browse files Browse the repository at this point in the history
  • Loading branch information
PaolaSantolloV authored Oct 24, 2023
2 parents 0ddce3b + cc09564 commit b9f7640
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,11 @@ jobs:
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GITHUB_KEY: ${{ secrets.API_GITHUB_KEY }}
with:
timeout: 60s
command_timeout: 30m
envs: DB_URL,DATABASE_URL,SESSION_SECRET,BASE_URL,AUTH0_CLIENT_ID,AUTH0_DOMAIN,AUTH0_CLIENT_SECRET,GOOGLE_APPLICATION_CREDENTIALS
envs: DB_URL,DATABASE_URL,SESSION_SECRET,BASE_URL,AUTH0_CLIENT_ID,AUTH0_DOMAIN,AUTH0_CLIENT_SECRET,GOOGLE_APPLICATION_CREDENTIALS,GITHUB_KEY
host: ${{ secrets.LIGHTSAIL_IP }}
username: ${{ secrets.LIGHTSAIL_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
Expand All @@ -225,6 +226,7 @@ jobs:
echo AUTH0_DOMAIN="$AUTH0_DOMAIN" >> .env
echo AUTH0_CLIENT_SECRET="$AUTH0_CLIENT_SECRET" >> .env
echo GOOGLE_APPLICATION_CREDENTIALS="$GOOGLE_APPLICATION_CREDENTIALS" >> .env
echo GITHUB_KEY="$GITHUB_KEY" >> .env
echo "*** Step: *** npm ci and build"
npm ci # install
Expand Down Expand Up @@ -316,10 +318,11 @@ jobs:
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GITHUB_KEY: ${{ secrets.API_GITHUB_KEY }}
with:
timeout: 60s
command_timeout: 30m
envs: DB_URL,DATABASE_URL,SESSION_SECRET,BASE_URL,AUTH0_CLIENT_ID,AUTH0_DOMAIN,AUTH0_CLIENT_SECRET,GOOGLE_APPLICATION_CREDENTIALS
envs: DB_URL,DATABASE_URL,SESSION_SECRET,BASE_URL,AUTH0_CLIENT_ID,AUTH0_DOMAIN,AUTH0_CLIENT_SECRET,GOOGLE_APPLICATION_CREDENTIALS,GITHUB_KEY
host: ${{ secrets.LIGHTSAIL_IP }}
username: ${{ secrets.LIGHTSAIL_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
Expand All @@ -343,6 +346,7 @@ jobs:
echo AUTH0_DOMAIN="$AUTH0_DOMAIN" >> .env
echo AUTH0_CLIENT_SECRET="$AUTH0_CLIENT_SECRET" >> .env
echo GOOGLE_APPLICATION_CREDENTIALS="$GOOGLE_APPLICATION_CREDENTIALS" >> .env
echo GITHUB_KEY="$GITHUB_KEY" >> .env
echo "*** Step: *** npm ci and build"
npm ci # install
Expand Down
14 changes: 9 additions & 5 deletions app/routes/api/github/get-proyectActivity.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { Octokit } from "@octokit/core";
import { env } from "process";
import { saveActivity } from "../../../models/githubactivity.server";
Expand All @@ -22,11 +23,14 @@ export const getActivity = async (repo: string, projectId: string) => {
try{
const repoActivity = await octokit.request(`GET /repos/${owner}/${repoUrlClean}/events`, {
owner,
repo,
}).catch((e) => { throw(e)});

repoUrlClean,
});
console.log('limit ', repoActivity.headers["x-ratelimit-limit"]);
console.log('ratelimit-remaining ', repoActivity.headers["x-ratelimit-remaining"]);

if(repoActivity.data.length){
if(repoActivity.status != 404){
// eslint-disable-next-line no-console
console.log( repoUrlClean , repoUrlClean , repoActivity.status, repoActivity.headers["x-ratelimit-limit"], repoActivity.headers["x-ratelimit-remaining"],repoActivity.data.length);
repoActivity.data?.forEach( (activity: { id: string; type: string; created_at: string; actor: { display_login: string; avatar_url: string; }; }) => {
saveActivity(activity.id ,
activity.type?.replace(/([a-z0-9])([A-Z])/g, '$1 $2') as string, //this is for separe the string with camel case into pieces
Expand All @@ -38,7 +42,7 @@ export const getActivity = async (repo: string, projectId: string) => {


}catch(e){
console.error(e);
console.error('the repo url doesnt exit', repoUrlClean);
}

}else{
Expand Down

0 comments on commit b9f7640

Please sign in to comment.