Skip to content

Commit efa60e0

Browse files
authored
feat(calendar): use ical (#194)
1 parent cae0e7f commit efa60e0

36 files changed

+154
-572
lines changed

.env.example

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,4 @@
33

44
# Required: HackMD Configuration
55
# HACKMD_API_TOKEN=your_hackmd_api_token
6-
# HACKMD_TEAM_NAME=your_hackmd_team_name_optional # Defaults to your own personal space
7-
8-
# Google Calendar API Authentication
9-
# You can get this from the Google Cloud Console
10-
# Create an API Key and restrict it to the Google Calendar API
11-
# GOOGLE_API_KEY=your_google_calendar_api_key_here
6+
# HACKMD_TEAM_NAME=your_hackmd_team_name_optional # Defaults to your own personal space

.github/workflows/create-meeting-artifacts-manual.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ jobs:
5757
env:
5858
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
5959
HACKMD_API_TOKEN: ${{ secrets.HACKMD_API_TOKEN }}
60-
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
61-
ADDITIONAL_ARGS: ${{ inputs.dry_run == 'true' && '--dry-run' || '' }}
60+
ADDITIONAL_ARGS: ${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }}
6261
run: node create-node-meeting-artifacts.mjs ${{ inputs.meeting_group }} --verbose $ADDITIONAL_ARGS
6362

6463
- name: Upload artifacts

README.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ A modern Node.js application that creates GitHub issues and HackMD documents for
66

77
- Node.js 22+ (LTS)
88
- GitHub Personal Access Token
9-
- Google Cloud Project with Calendar API enabled (for meeting scheduling)
10-
- Google API Key for Calendar access
119
- HackMD API Token (for meeting minutes)
1210

1311
## 🔑 Authentication Setup
@@ -26,19 +24,6 @@ A modern Node.js application that creates GitHub issues and HackMD documents for
2624
3. Create a new API token for the meeting artifacts tool
2725
4. Optionally, create or join a team workspace for better organization
2826

29-
### Google Authentication (Calendar Only)
30-
31-
#### API Key Authentication (Recommended)
32-
33-
1. Go to [Google Cloud Console](https://console.cloud.google.com/)
34-
2. Create a new project or select an existing one
35-
3. Enable the Google Calendar API
36-
4. Go to **Credentials****Create Credentials****API Key**
37-
5. Restrict the API key to the Google Calendar API for security
38-
6. Add the API key to your environment variables as `GOOGLE_API_KEY`
39-
40-
**Note:** API Keys provide simplified authentication and are sufficient for read-only calendar access. They don't require complex OAuth flows or service account setup.
41-
4227
## 📁 Project Structure
4328

4429
```
@@ -47,7 +32,7 @@ create-node-meeting-artifacts/
4732
│ ├── config.mjs # Configuration management
4833
│ ├── constants.mjs # Application constants
4934
│ ├── github.mjs # GitHub API integration
50-
│ ├── google.mjs # Google APIs integration
35+
│ ├── calendar.mjs # Calendar integration
5136
│ ├── meeting.mjs # Meeting operations
5237
│ └── utils.mjs # Utility functions
5338
├── templates/ # Meeting templates
@@ -202,15 +187,13 @@ The application creates:
202187

203188
- `GITHUB_TOKEN`: GitHub Personal Access Token
204189
- `HACKMD_API_TOKEN`: HackMD API token for creating and managing documents
205-
- `GOOGLE_API_KEY`: Google Calendar API Key for read-only calendar access
206190

207191
### Meeting Base Configuration
208192

209193
Each `meeting_base_<group>` file contains:
210194

211195
```bash
212196
CALENDAR_FILTER="Meeting Name in Calendar"
213-
CALENDAR_ID="nodejs.org_nr77ama8p7d7f9ajrpnu506c98@group.calendar.google.com"
214197
USER="nodejs"
215198
REPO="repository-name"
216199
GROUP_NAME="Full Group Name"

TEMPLATES_DOCUMENTATION.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ There are several variables in the documents that need to be configured:
1818
The following properties are available in meeting base templates and can be used in meeting issue generation:
1919

2020
- **`CALENDAR_FILTER`:** The name of calendar events that mark the group's meeting date/time
21-
- **`CALENDAR_ID`:** The Google Calendar ID for the Node.js calendar (typically `nodejs.org_nr77ama8p7d7f9ajrpnu506c98@group.calendar.google.com`)
21+
- **`ICAL_URL`:** The ICAL URL for a given meetings' calendar
2222
- **`USER`:** The GitHub username/organization (typically `nodejs`)
2323
- **`REPO`:** The repository name where meeting issues are created
2424
- **`GROUP_NAME`:** The full name of the Committee, Working Group, Initiative, or Team
@@ -55,7 +55,7 @@ A base of metadata and some content for the issue to be created on time, with ag
5555

5656
```
5757
CALENDAR_FILTER="<calendar event name>"
58-
CALENDAR_ID="nodejs.org_nr77ama8p7d7f9ajrpnu506c98@group.calendar.google.com"
58+
ICAL_URL="<ical url>"
5959
USER="nodejs"
6060
REPO="<repo>"
6161
GROUP_NAME="<name>"
@@ -72,7 +72,7 @@ JOINING_INSTRUCTIONS="
7272

7373
```
7474
CALENDAR_FILTER="Node.js Community Committee"
75-
CALENDAR_ID="nodejs.org_nr77ama8p7d7f9ajrpnu506c98@group.calendar.google.com"
75+
ICAL_URL="<...>"
7676
USER="nodejs"
7777
REPO="community-committee"
7878
GROUP_NAME="Community Committee"

create-node-meeting-artifacts.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
import { Command } from 'commander';
1313

14+
import * as calendar from './src/calendar.mjs';
1415
import environmentConfig from './src/config.mjs';
1516
import * as github from './src/github.mjs';
16-
import * as google from './src/google.mjs';
1717
import * as hackmd from './src/hackmd.mjs';
1818
import * as meetings from './src/meeting.mjs';
1919

@@ -32,9 +32,6 @@ const config = {
3232
meetingGroup: program.args[0],
3333
};
3434

35-
// Step 2: Initialize Google Calendar client with API Key
36-
const calendarClient = google.createCalendarClient(config.google);
37-
3835
// Step 3: Initialize GitHub client
3936
const githubClient = github.createGitHubClient(config);
4037

@@ -67,10 +64,11 @@ if (config.dryRun) {
6764
}
6865

6966
// Step 6: Find next meeting event in calendar
70-
const event = await google.findNextMeetingEvent(calendarClient, meetingConfig);
67+
const events = await calendar.getEventsFromCalendar(
68+
meetingConfig.properties.ICAL_URL
69+
);
7170

72-
// Step 7: Extract meeting date from event
73-
const meetingDate = new Date(event.start.dateTime);
71+
const meetingDate = await calendar.findNextMeetingDate(events, meetingConfig);
7472

7573
// Step 8: Get Meeting Title
7674
const meetingTitle = meetings.generateMeetingTitle(

global.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
* This file makes types from third-party libraries available globally without imports in JSDoc comments
44
*/
55

6-
import type { calendar_v3 } from '@googleapis/calendar';
76
import type { RestEndpointMethodTypes } from '@octokit/rest';
87
import type { API } from '@hackmd/api';
98
import type { SingleNote } from '@hackmd/api/dist/type.d.ts';
109

1110
declare global {
12-
// Google API type aliases
13-
type CalendarEvent = calendar_v3.Schema$Event;
14-
type CalendarClient = calendar_v3.Calendar;
1511
type HackMDClient = API;
1612
type HackMDNote = SingleNote;
1713

0 commit comments

Comments
 (0)