Skip to content

Commit

Permalink
fix: added log for exisitng meetings
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Mar 2, 2024
1 parent 82949a0 commit be2e788
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
schedules: 2020-04-02T17:00:00.0Z/P1D
issueTitle: 'Test Meeting <%= date.toFormat("yyyy-MM-dd") %>'
createWithin: P2D
meetingLabels: testMeeting, test
meetingLabels: test
agendaLabel: meeting-agenda-test
createNotes: true
repos: pkgjs/meet,pkgjs/meet
Expand Down
1 change: 1 addition & 0 deletions lib/issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports.update = async function (client, issue) {
}

module.exports.getMeetingIssues = async function (client, opts) {
console.log(`Checking for meeting issues ${opts.owner}/${opts.repo}#${opts.meetingLabels}`)
const resp = await client.paginate('GET /repos/{owner}/{repo}/issues', {
owner: opts.owner,
repo: opts.repo,
Expand Down
6 changes: 5 additions & 1 deletion lib/meetings.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,22 @@ const shouldCreateNextMeetingIssue = module.exports.shouldCreateNextMeetingIssue
return false
}

console.log(`Checking for existing meeting ${opts.owner}/${opts.repo}#${opts.meetingLabels}`)
const meetings = await issues.getMeetingIssues(client, {
owner: opts.owner,
repo: opts.repo,
label: opts.meetingLabels
meetingLabels: opts.meetingLabels
})

const shouldCreate = !meetings.find((i) => {
return i.title === nextIssueTitle
})
if (!shouldCreate) {
console.log(`Found existing meeting issue: #${shouldCreate.id}`)
return false
}
console.log('No existing meeting issues found')
console.log(meetings)

// Load issues for agenda
return issue
Expand Down
2 changes: 1 addition & 1 deletion run.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const conversions = require('./lib/conversions')
const createWithin = core.getInput('createWithin')

// variables we use for labels
const meetingLabels = core.getInput('meetingLabels')
const agendaLabel = core.getInput('agendaLabel')
let meetingLabels = core.getInput('meetingLabels')

// variables we use for content
const issueTitle = core.getInput('issueTitle')
Expand Down

0 comments on commit be2e788

Please sign in to comment.