github.mjs module wraps @octokit/rest to search for agenda issues, create meeting issues, and update existing ones.
createGitHubClient(config)
Creates an authenticated Octokit REST client.
Parameters
Application configuration. Reads
config.githubToken for the Authorization header and config.verbose to optionally attach console as the Octokit logger.Returns
Octokit — a configured @octokit/rest client instance. When verbose is true, all API request and response details are logged via console.
getAgendaIssues(githubClient, config, meetingConfig)
Searches the GitHub organisation for all open issues that carry the meeting group’s agenda label, then groups them by repository.
Parameters
Authenticated Octokit client returned by
createGitHubClient.Application configuration. Reads
config.meetingGroup to derive the default agenda label when AGENDA_TAG is not set in the template.Meeting configuration returned by
readMeetingConfig. Reads properties.USER (GitHub org) and properties.AGENDA_TAG (label name).Returns
Promise<Record<string, GitHubIssue[]>> — an object mapping repository paths (e.g., "nodejs/node") to arrays of matching issues. Uses paginate internally so all pages of results are returned, not just the first page.
sortIssuesByRepo(issues)
Groups a flat array of GitHub issues by their repository path.
Parameters
Flat array of GitHub issue objects, each containing a
repository_url field (e.g., "https://api.github.com/repos/nodejs/node").Returns
Record<string, GitHubIssue[]> — issues grouped by the last two path segments of repository_url (owner/repo format).
createOrUpdateGitHubIssue(githubClient, config, meetingConfig, title, content)
The primary entry point for writing a meeting issue. Decides whether to create a new issue or update an existing one based on the --force flag and an exact title search.
Parameters
Authenticated Octokit client.
Application configuration. Reads
config.force to decide whether to skip the duplicate check.Meeting configuration. Provides the target repository and org.
The meeting title to use as the issue title (e.g.,
"Node.js Technical Steering Committee (TSC) Meeting 2025-03-19").The fully rendered issue body markdown.
Returns
Promise<GitHubIssue> — the created or existing issue object.
Logic:
- If
forceisfalse: callsfindGitHubIssueByTitle. If an issue is found and the body differs, callsupdateGitHubIssue, then returns the existing issue object. If the body is identical, returns the existing issue without any write. - If
forceistrueor no existing issue is found: callscreateGitHubIssue.
createGitHubIssue(githubClient, meetingConfig, title, content)
Creates a new GitHub issue in the repository configured in the meeting template.
Parameters
Authenticated Octokit client.
Meeting configuration. Reads
properties.USER (owner), properties.REPO (repo), and optionally properties.ISSUE_LABEL (applied as a label array).Issue title.
Issue body markdown.
Returns
Promise<GitHubIssue> — the newly created issue data from the GitHub API (response.data).
updateGitHubIssue(githubClient, issueNumber, content, meetingConfig)
Updates the body of an existing GitHub issue.
Parameters
Authenticated Octokit client.
The issue number to update.
The new issue body markdown.
Meeting configuration. Reads
properties.USER (owner) and properties.REPO (repo).Returns
Promise<void> — resolves when the update API call completes.
findGitHubIssueByTitle(githubClient, title, meetingConfig)
Searches for an open GitHub issue with an exact title match using the GitHub search API.
Parameters
Authenticated Octokit client.
The exact issue title to search for. The query uses
in:title and is:open to narrow results to the configured repository.Meeting configuration. Reads
properties.USER (owner) and properties.REPO (repo) to scope the search query to a single repository.Returns
Promise<GitHubIssue | undefined> — the first matching issue, or undefined if no match is found. Only the first result is requested (per_page: 1).