Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
fix(stats): output payload #18
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Sep 5, 2020
1 parent 6dcb532 commit 2012e64
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const admin = require('firebase-admin');
credential: admin.credential.cert(JSON.parse(firebaseKey)),
});

const db = admin.firestore();
const author = github.context.payload.sender;
// const db = admin.firestore();
// const author = github.context.payload.sender;
const type = process.env.GITHUB_EVENT_NAME;
console.log(github.context.payload);
const docRef = db.collection('usersGitHub').doc(author.id);
await docRef.set({
...author,
type: admin.firestore.FieldValue.increment(1)
}, { merge: true });
console.log(type, github.context.payload);
// const docRef = db.collection('usersGitHub').doc(author.id);
// await docRef.set({
// ...author,
// type: admin.firestore.FieldValue.increment(1)
// }, { merge: true });
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit 2012e64

Please sign in to comment.