From 57eecbb6eff690c805ebfdc4659644e2e63b8da1 Mon Sep 17 00:00:00 2001 From: Jon Church Date: Thu, 21 Nov 2024 19:05:02 -0500 Subject: [PATCH] update readme w/ template inputs --- README.md | 81 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e856076..befdc3f 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,13 @@ jobs: - uses: pkgjs/meet@v0 with: token: ${{ secrets.GITHUB_TOKEN }} - schedules: 2020-04-02T17:00:00.0Z/P1D + schedules: 2020-04-02T17:00:00.0Z/P1D # Every 1 day from 2020-04-02 at 5PM UTC + createWithin: P2D # Create issue 2 days before the scheduled meeting ``` -### Inputs +### Github Action Inputs -The meeting schedule, issue, etc can be configured with inouts to this action. +The meeting schedule, issue, etc can be configured with inputs to this action. - `token`: (required) The token from the action for calling to the GitHub API. - `schedules`: (required) The ISO-8601 interval for the schedule. Default: `${now/P7D}` seven days from now @@ -54,29 +55,75 @@ If you don't want to use the default issue template, you can use a custom issue You can use both our shorthand and JavaScript in your meeting templates. -#### Shorthand in Your Custom Meeting Templates +## Template Data and Automatic Replacements -We provide some shorthand that you can use in your meeting templates. We'll automatically replace the shorthand with the relevant dynamic information. +#### Autoreplacing Shorthand in Custom Meeting Templates -- Title: - - Shorthand: `` - - Result: The issue's title. -- Agenda Label: - - Shorthand: `` - - Result: The label for agenda items to be pulled from that you've defined in the Action's YAML configuration. -- Invitees: - - Shorthand: `` - - Result: The list of invitees you've defined in the Action's YAML configuration. -- Observers: - - Shorthand: `` - - Result: The list of observers you've defined in the Action's YAML configuration. +We provide some shorthand that you can use in your meeting templates. We'll automatically replace the shorthand with the relevant dynamic information. If you'd like to see more shorthand available, we absolutely welcome PRs. +- **``**: The issue's title. +- **``**: The label for agenda items to be pulled from that you've defined in the Action's YAML configuration. +- **``**: The list of invitees you've defined in the Action's YAML configuration. +- **``**: The list of observers you've defined in the Action's YAML configuration. + +```md +## Title + + +## Agenda Items +Extracted from issues labeled with . + +## Participants +- Invitees: +- Observers: +``` + #### JavaScript in Your Custom Meeting Templates You can include custom JavaScript in your custom meeting templates. We use [ejs](https://ejs.co/), so anything within an ejs tag will be parsed as JavaScript. +When using EJS templates for your meeting issues, the following data properties are available: + +#### EJS Template Data + +- **`date`**: The date of the meeting, formatted using Luxon. +- **`agendaIssues`**: A list of agenda issues, each with properties like `title`, `number`, and `html_url`. +- **`agendaLabel`**: The label used to identify agenda items. +- **`meetingNotes`**: A link or content for meeting notes. +- **`owner`**: The GitHub repository owner. +- **`repo`**: The GitHub repository name. +- **`title`**: The title of the issue, which can be dynamically generated. +- **`invitees`**: A list of invitees, if provided. +- **`observers`**: A list of observers, if provided. + +```ejs +<% const timezones = [ + 'America/Los_Angeles', + 'Asia/Tokyo', +]; %> + +# <%= title %> + +## Date/Time +| Timezone | Date/Time | +|----------|-----------| +<% timezones.forEach(zone => { %> +| <%= zone %> | <%= date.setZone(zone).toFormat('EEE dd-MMM-yyyy HH:mm (hh:mm a)') %> | +<% }) %> + +## Agenda +Extracted from **<%= agendaLabel %>** labeled issues and pull requests from **<%= owner %>/<%= repo %>**. + +<% agendaIssues.forEach(issue => { %> +- <%= issue.title %> [#<%= issue.number %>](<%= issue.html_url %>) +<% }) %> + +## Meeting Notes +<%= meetingNotes || 'No notes available.' %> +``` + ### JS API Usage The main logic of the module is also published to npm.