Skip to content
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

chore(.github): PR bot logs #15768

Merged
merged 1 commit into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/high-priority-prs/src/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ module.exports = async () => {
// ".github/actions/high-priority-prs/src/data.json"
// )
// data = JSON.parse(filecontents)
tools.log.info("-----------BEGIN DATA-----------")
tools.log.info(data.repository.pullRequests)
tools.log.info(data.repository.pullRequests.nodes[0])
tools.log.info("-----------END DATA-----------")
} catch (error) {
tools.log.fatal(error)
tools.exit.failure()
Expand Down
1 change: 1 addition & 0 deletions .github/actions/high-priority-prs/src/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const filter = (queues, team) => {
return pr.reviewRequests.nodes
.map(node => {
if (node.requestedReviewer) {
tools.log.info(`Review request for team ${node.requestedReviewer.name} on PR: ${pr.title}`)
return node.requestedReviewer.id
}
})
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/high-priority-prs/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { Toolkit } = require("actions-toolkit")
const tools = new Toolkit()
const fetch = require("./fetch.js")
const { processData, report } = require("./process-data.js")
const { filter } = require("./filter.js")
Expand All @@ -22,9 +24,11 @@ const start = async function() {
await Promise.all(teams.map(team => {
if (team.name === `core`) {
// send report of all PRs (without filtering) to Core
tools.log.info(`-> Reporting for ${team.name} team`)
return report({ queues, channelId: team.channelId })
} else {
// send filtered reports to respective teams
tools.log.info(`-> Reporting for ${team.name} team`)
return report(filter(queues, team))
}
}))
Expand Down