Skip to content

Commit

Permalink
Merge branch 'master-github-upstream' into feature/update_next_major_…
Browse files Browse the repository at this point in the history
…spec_with_master

# Conflicts:
#	package-lock.json
#	package.json
  • Loading branch information
jonaslagoni committed Dec 9, 2022
2 parents c3e7118 + b7bb011 commit a10f733
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 65 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/if-nodejs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ on:
jobs:

test-nodejs:
# We just check the message of first commit as there is always just one commit because we squash into one before merging
# "commits" contains array of objects where one of the properties is commit "message"
# Release workflow will be skipped if release conventional commits are not used
if: |
startsWith( github.repository, 'asyncapi/' ) &&
(startsWith( github.event.commits[0].message , 'fix:' ) ||
startsWith( github.event.commits[0].message, 'fix!:' ) ||
startsWith( github.event.commits[0].message, 'feat:' ) ||
startsWith( github.event.commits[0].message, 'feat!:' ))
name: Test NodeJS release on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/notify-tsc-members-mention.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,22 @@ on:
issue_comment:
types:
- created
- edited

discussion_comment:
types:
- created
- edited

issues:
types:
- opened
- reopened

pull_request_target:
types:
- opened
- reopened
- ready_for_review

discussion:
types:
- created
- edited

jobs:
issue:
Expand Down Expand Up @@ -75,7 +69,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.issue.html_url}}');
sendEmail('${{github.event.issue.html_url}}', '${{github.event.issue.title}}');
pull_request:
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -120,7 +114,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.pull_request.html_url}}');
sendEmail('${{github.event.pull_request.html_url}}', '${{github.event.pull_request.title}}');
discussion:
if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -165,7 +159,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.discussion.html_url}}');
sendEmail('${{github.event.discussion.html_url}}', '${{github.event.discussion.title}}');
issue_comment:
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }}
Expand Down Expand Up @@ -210,7 +204,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}');
pr_comment:
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -255,7 +249,7 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}');
discussion_comment:
if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -300,4 +294,4 @@ jobs:
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.discussion.title}}');
4 changes: 2 additions & 2 deletions .github/workflows/scripts/mailchimp/htmlContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This code is centrally managed in https://github.com/asyncapi/.github/
* Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
*/
module.exports = (link) => {
module.exports = (link, title) => {

return `<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
Expand Down Expand Up @@ -386,7 +386,7 @@ There is a new topic at AsyncAPI Initiative that requires Technical Steering Com
<br>
Please have a look if it is just something you need to be aware of, or maybe your vote is needed.
<br>
<a href="${ link }" style="color:#007c89;font-weight:normal;text-decoration:underline" target="_blank">Click here to see more details on GitHub</a>.
Topic: <a href="${ link }" style="color:#007c89;font-weight:normal;text-decoration:underline" target="_blank">${ title }</a>.
</td>
</tr>
</tbody></table>
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/scripts/mailchimp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const htmlContent = require('./htmlContent.js');
* Sending API request to mailchimp to schedule email to subscribers
* Input is the URL to issue/discussion or other resource
*/
module.exports = async (link) => {
module.exports = async (link, title) => {

let newCampaign;

Expand All @@ -27,12 +27,18 @@ module.exports = async (link) => {
type: 'regular',
recipients: {
list_id: '6e3e437abe',
segments_opts: {
saved_segment_id: 'tsc-voting-email'
segment_opts: {
match: 'any',
conditions: [{
condition_type: 'Interests',
field: 'interests-2801e38b9f',
op: 'interestcontains',
value: ['f7204f9b90']
}]
}
},
settings: {
subject_line: 'AsyncAPI TSC members attention required',
subject_line: `TSC attention required: ${ title }`,
preview_text: 'Check out the latest topic that TSC members have to be aware of',
title: `New topic info - ${ new Date(Date.now()).toUTCString()}`,
from_name: 'AsyncAPI Initiative',
Expand All @@ -47,7 +53,7 @@ module.exports = async (link) => {
* Content of the email is added separately after campaign creation
*/
try {
await mailchimp.campaigns.setContent(newCampaign.id, { html: htmlContent(link) });
await mailchimp.campaigns.setContent(newCampaign.id, { html: htmlContent(link, title) });
} catch (error) {
return core.setFailed(`Failed adding content to campaign: ${ JSON.stringify(error) }`);
}
Expand Down
21 changes: 9 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import type { JSONSchema7 } from 'json-schema';

declare module '@asyncapi/specs' {
const specs: {
'2.0.0': JSONSchema7,
'2.1.0': JSONSchema7,
'2.2.0': JSONSchema7,
'2.3.0': JSONSchema7,
'2.4.0': JSONSchema7,
'2.5.0': JSONSchema7,
}

export default specs;
}
declare const _exports: {
'2.0.0': JSONSchema7;
'2.1.0': JSONSchema7;
'2.2.0': JSONSchema7;
'2.3.0': JSONSchema7;
'2.4.0': JSONSchema7;
'2.5.0': JSONSchema7;
};
export = _exports;
59 changes: 29 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions schemas/2.5.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,6 @@
"type": "string",
"description": "A runtime expression that specifies the location of the parameter value",
"pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*"
},
"$ref": {
"$ref": "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json"
}
}
},
Expand Down Expand Up @@ -1832,7 +1829,14 @@
"$id": "http://asyncapi.com/definitions/2.5.0/parameters.json",
"type": "object",
"additionalProperties": {
"$ref": "http://asyncapi.com/definitions/2.5.0/parameter.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/2.5.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/2.5.0/parameter.json"
}
]
},
"description": "JSON objects describing re-usable channel parameters."
}
Expand Down

0 comments on commit a10f733

Please sign in to comment.