Skip to content

Commit

Permalink
feat: add meetingLabel support
Browse files Browse the repository at this point in the history
  • Loading branch information
bnb committed Mar 30, 2020
1 parent f88068b commit 14879a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
agenda-label:
description: 'GitHub label to build the agenda off of. All issues that'
required: true
meeting-label:
description: 'GitHub label to add to the created issue.'
required: true
invites:
description: 'String of people or teams to invite via @mention'
required: false
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async function action () {
const join = core.getInput('markdown-join-instructions')
const template = core.getInput('markdown-minutes-base')
const agendaLabel = core.getInput('agenda-label')
const meetingLabel = core.getInput('meeting-label')
const invites = core.getInput('invites')
const observers = core.getInput('observers')

Expand All @@ -32,6 +33,7 @@ async function action () {
githubIssue: '{{{github-issue}}}',
minutesDocument: '{{{minutes-document}}}',
agendaLabel: '{{{agenda-label}}}',
meetingLabel: '{{{meeting-label}}}',
invited: '{{{invited}}}',
agenda: '{{{agenda}}}'
}
Expand All @@ -41,6 +43,7 @@ async function action () {
githubIssue: 'a link goes here, probably retuned from Octokit',
minutesDocument: 'a link goes here, probably generated by google docs but I want to make it pluggable so people can swap them for something like CodiMD',
agendaLabel: agendaLabel,
meetingLabel: meetingLabel,
invited: invites,
observers: observers,
agenda: 'the agenda generated from the passed label will be added here'
Expand Down
5 changes: 5 additions & 0 deletions lib/replaceVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ async function replaceVariables (stringifiedTemplate, templateVariables, templat
stringifiedTemplate = stringifiedTemplate.replace(templateVariables.agendaLabel, templateValues.agendaLabel)
}

// - replace meeting label
if (stringifiedTemplate.includes(templateVariables.agendaLabel)) {
stringifiedTemplate = stringifiedTemplate.replace(templateVariables.agendaLabel, templateValues.agendaLabel)
}

// - replace invited
if (stringifiedTemplate.includes(templateVariables.invited)) {
stringifiedTemplate = stringifiedTemplate.replace(templateVariables.invited, templateValues.invited)
Expand Down

0 comments on commit 14879a2

Please sign in to comment.