From b1d2ead46e4cee08a5bdb2f516169921237d49b9 Mon Sep 17 00:00:00 2001 From: Steven Presti Date: Wed, 10 Jan 2024 16:59:34 -0500 Subject: [PATCH] actionItems: Update action for new file structure With the change over from IRC bot to matrix bot there seems to be a small structural change in how the logs are hosted. You can see the following examples new https://meetbot-raw.fedoraproject.org/meeting-1_matrix_fedoraproject-org/ vs old https://meetbot-raw.fedoraproject.org/teams/fedora_coreos_meeting/ --- .github/linters/.eslintrc.yml | 3 ++- .github/workflows/create-meeting.yml | 2 +- dist/index.js | 13 ++++++++----- src/actionItems.ts | 14 +++++++++----- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/linters/.eslintrc.yml b/.github/linters/.eslintrc.yml index f452aba..f8c2b3e 100644 --- a/.github/linters/.eslintrc.yml +++ b/.github/linters/.eslintrc.yml @@ -79,5 +79,6 @@ rules: '@typescript-eslint/semi': ['error', 'never'], '@typescript-eslint/space-before-function-paren': 'off', '@typescript-eslint/type-annotation-spacing': 'error', - '@typescript-eslint/unbound-method': 'error' + '@typescript-eslint/unbound-method': 'error', + 'prefer-template': 'off' } diff --git a/.github/workflows/create-meeting.yml b/.github/workflows/create-meeting.yml index c541a41..964b21e 100644 --- a/.github/workflows/create-meeting.yml +++ b/.github/workflows/create-meeting.yml @@ -34,5 +34,5 @@ jobs: uses: ./ with: issueTitle: 'FCOS Meeting Checklist' - rootURLMeetingLogs: 'https://meetbot-raw.fedoraproject.org/teams/fedora_coreos_meeting/' + rootURLMeetingLogs: 'https://meetbot-raw.fedoraproject.org/meeting-1_matrix_fedoraproject-org/' trackingRepo: 'coreos/fedora-coreos-tracker' diff --git a/dist/index.js b/dist/index.js index eb46b8b..459995a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -22828,16 +22828,19 @@ async function GetActionItems() { console.log(`GetActionItems started`); // Set constants const actionItemsRegEx = new RegExp(`(?<=Action Items\n------------\n)((.|\n)*)(?=Action Items,)`); - const meetingListRegEx = new RegExp(`(?<=>fedora_coreos_meeting.)(.*?)=?txt`, `g`); - const meetingNotesURL = core.getInput('rootURLMeetingLogs'); - let lastMeetingNotesUrl = `fedora_coreos_meeting.`; + const meetingListRegEx = new RegExp(`(?<=>fedora-coreos-meeting.)(.*?)=?txt`, `g`); + const allMeetingNotes = core.getInput('rootURLMeetingLogs'); + const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000) + .toISOString() + .split('T')[0]; + const meetingNotesURL = allMeetingNotes + sevenDaysAgo + `/`; const listOfMeetings = await fetchData(meetingNotesURL); const matches = listOfMeetings.match(meetingListRegEx); if (matches != null) { const lastMeeting = matches[matches.length - 1]; // This should be the latest meeting`s date in with the format of YYYY-MM-DD-HH.MM.txt - lastMeetingNotesUrl = meetingNotesURL + lastMeetingNotesUrl + lastMeeting; - console.debug(`last meeting notes url${lastMeetingNotesUrl}`); + const lastMeetingNotesUrl = meetingNotesURL + 'fedora-coreos-meeting.' + lastMeeting; + console.debug(`last meeting notes url ${lastMeetingNotesUrl}`); const lastMeetingNotes = await fetchData(lastMeetingNotesUrl); const actionItemMatches = actionItemsRegEx.exec(lastMeetingNotes); if (actionItemMatches) { diff --git a/src/actionItems.ts b/src/actionItems.ts index c7f2a84..240680b 100644 --- a/src/actionItems.ts +++ b/src/actionItems.ts @@ -8,19 +8,23 @@ export async function GetActionItems(): Promise { `(?<=Action Items\n------------\n)((.|\n)*)(?=Action Items,)` ) const meetingListRegEx = new RegExp( - `(?<=>fedora_coreos_meeting.)(.*?)=?txt`, + `(?<=>fedora-coreos-meeting.)(.*?)=?txt`, `g` ) - const meetingNotesURL = core.getInput('rootURLMeetingLogs') - let lastMeetingNotesUrl = `fedora_coreos_meeting.` + const allMeetingNotes = core.getInput('rootURLMeetingLogs') + const sevenDaysAgo: string = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000) + .toISOString() + .split('T')[0] + const meetingNotesURL = allMeetingNotes + sevenDaysAgo + `/` const listOfMeetings = await fetchData(meetingNotesURL) const matches = listOfMeetings.match(meetingListRegEx) if (matches != null) { const lastMeeting = matches[matches.length - 1] // This should be the latest meeting`s date in with the format of YYYY-MM-DD-HH.MM.txt - lastMeetingNotesUrl = meetingNotesURL + lastMeetingNotesUrl + lastMeeting - console.debug(`last meeting notes url${lastMeetingNotesUrl}`) + const lastMeetingNotesUrl = + meetingNotesURL + 'fedora-coreos-meeting.' + lastMeeting + console.debug(`last meeting notes url ${lastMeetingNotesUrl}`) const lastMeetingNotes = await fetchData(lastMeetingNotesUrl) const actionItemMatches = actionItemsRegEx.exec(lastMeetingNotes)