Skip to content

Commit

Permalink
update readme w/ template inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchurch committed Nov 22, 2024
1 parent 61042a3 commit 57eecbb
Showing 1 changed file with 64 additions and 17 deletions.
81 changes: 64 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: `<!-- title -->`
- Result: The issue's title.
- Agenda Label:
- Shorthand: `<!-- agenda label -->`
- Result: The label for agenda items to be pulled from that you've defined in the Action's YAML configuration.
- Invitees:
- Shorthand: `<!-- invitees -->`
- Result: The list of invitees you've defined in the Action's YAML configuration.
- Observers:
- Shorthand: `<!-- observers -->`
- 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.

- **`<!-- title -->`**: The issue's title.
- **`<!-- agenda label -->`**: The label for agenda items to be pulled from that you've defined in the Action's YAML configuration.
- **`<!-- invitees -->`**: The list of invitees you've defined in the Action's YAML configuration.
- **`<!-- observers -->`**: The list of observers you've defined in the Action's YAML configuration.

```md
## Title
<!-- title -->
## Agenda Items
Extracted from issues labeled with <!-- agenda label -->.
## Participants
- Invitees: <!-- invitees -->
- Observers: <!-- 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.
Expand Down

0 comments on commit 57eecbb

Please sign in to comment.