From be2e78883241fa2a23979ed084f2dbe548be333f Mon Sep 17 00:00:00 2001 From: Wes Todd Date: Sat, 2 Mar 2024 12:43:28 -0600 Subject: [PATCH] fix: added log for exisitng meetings --- .github/workflows/test.yml | 2 +- lib/issues.js | 1 + lib/meetings.js | 6 +++++- run.js | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0124725..ae08d8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/lib/issues.js b/lib/issues.js index dc1c402..753da8a 100644 --- a/lib/issues.js +++ b/lib/issues.js @@ -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, diff --git a/lib/meetings.js b/lib/meetings.js index 82c4e51..9772c4e 100644 --- a/lib/meetings.js +++ b/lib/meetings.js @@ -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 diff --git a/run.js b/run.js index fbbce15..5b9b185 100644 --- a/run.js +++ b/run.js @@ -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')