@asyncapi/converter 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -3
- package/lib/convert.d.ts +3 -0
- package/lib/convert.js +193 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -212
- package/lib/interfaces.d.ts +7 -0
- package/lib/interfaces.js +2 -0
- package/lib/utils.d.ts +21 -0
- package/lib/utils.js +114 -0
- package/package.json +21 -6
- package/.github/workflows/add-good-first-issue-labels.yml +0 -68
- package/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +0 -54
- package/.github/workflows/automerge-for-humans-merging.yml +0 -32
- package/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml +0 -35
- package/.github/workflows/automerge-orphans.yml +0 -63
- package/.github/workflows/automerge.yml +0 -50
- package/.github/workflows/autoupdate.yml +0 -32
- package/.github/workflows/bump.yml +0 -33
- package/.github/workflows/help-command.yml +0 -43
- package/.github/workflows/if-go-pr-testing.yml +0 -68
- package/.github/workflows/if-nodejs-pr-testing.yml +0 -60
- package/.github/workflows/if-nodejs-release.yml +0 -85
- package/.github/workflows/if-nodejs-version-bump.yml +0 -48
- package/.github/workflows/issues-prs-notifications.yml +0 -72
- package/.github/workflows/lint-pr-title.yml +0 -22
- package/.github/workflows/notify-tsc-members-mention.yml +0 -142
- package/.github/workflows/release-announcements.yml +0 -76
- package/.github/workflows/sentiment-analysis.yml +0 -44
- package/.github/workflows/stale-issues-prs.yml +0 -42
- package/.github/workflows/welcome-first-time-contrib.yml +0 -83
- package/CODEOWNERS +0 -8
- package/lib/helpers.js +0 -109
- package/test/index.js +0 -257
- package/test/input/1.0.0/streetlights.yml +0 -120
- package/test/input/1.1.0/streetlights.yml +0 -120
- package/test/input/1.2.0/gitter-streaming.yml +0 -140
- package/test/input/1.2.0/slack-rtm.yml +0 -876
- package/test/input/1.2.0/streetlights.yml +0 -120
- package/test/input/2.0.0/streetlights.json +0 -172
- package/test/input/2.0.0/streetlights.yml +0 -112
- package/test/input/2.0.0-rc1/streetlights.yml +0 -109
- package/test/input/2.0.0-rc2/streetlights.yml +0 -112
- package/test/input/2.1.0/streetlights.yml +0 -112
- package/test/input/2.2.0/streetlights.yml +0 -112
- package/test/output/2.0.0/gitter-streaming.yml +0 -137
- package/test/output/2.0.0/slack-rtm.yml +0 -879
- package/test/output/2.0.0/streetlights.yml +0 -112
- package/test/output/2.0.0-rc1/gitter-streaming.yml +0 -137
- package/test/output/2.0.0-rc1/slack-rtm.yml +0 -879
- package/test/output/2.0.0-rc1/streetlights.yml +0 -109
- package/test/output/2.0.0-rc2/gitter-streaming.yml +0 -137
- package/test/output/2.0.0-rc2/slack-rtm.yml +0 -879
- package/test/output/2.0.0-rc2/streetlights.yml +0 -112
- package/test/output/2.1.0/streetlights.json +0 -172
- package/test/output/2.1.0/streetlights.yml +0 -112
- package/test/output/2.2.0/streetlights.yml +0 -112
- package/test/output/2.3.0/streetlights.yml +0 -112
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#This action is centrally managed in https://github.com/asyncapi/.github/
|
|
2
|
-
#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
|
|
3
|
-
#It does magic only if there is package.json file in the root of the project
|
|
4
|
-
name: Version bump - if Node.js project
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types:
|
|
9
|
-
- published
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
version_bump:
|
|
13
|
-
name: Generate assets and bump
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- name: Checkout repository
|
|
17
|
-
uses: actions/checkout@v2
|
|
18
|
-
with:
|
|
19
|
-
# target branch of release. More info https://docs.github.com/en/rest/reference/repos#releases
|
|
20
|
-
# in case release is created from release branch then we need to checkout from given branch
|
|
21
|
-
# if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working
|
|
22
|
-
ref: ${{ github.event.release.target_commitish }}
|
|
23
|
-
- name: Check if Node.js project and has package.json
|
|
24
|
-
id: packagejson
|
|
25
|
-
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
|
|
26
|
-
- if: steps.packagejson.outputs.exists == 'true'
|
|
27
|
-
name: Install dependencies
|
|
28
|
-
run: npm install
|
|
29
|
-
- if: steps.packagejson.outputs.exists == 'true'
|
|
30
|
-
name: Assets generation
|
|
31
|
-
run: npm run generate:assets
|
|
32
|
-
- if: steps.packagejson.outputs.exists == 'true'
|
|
33
|
-
name: Bump version in package.json
|
|
34
|
-
# There is no need to substract "v" from the tag as version script handles it
|
|
35
|
-
# When adding "bump:version" script in package.json, make sure no tags are added by default (--no-git-tag-version) as they are already added by release workflow
|
|
36
|
-
# When adding "bump:version" script in package.json, make sure --allow-same-version is set in case someone forgot and updated package.json manually and we want to avoide this action to fail and raise confusion
|
|
37
|
-
run: VERSION=${{github.event.release.tag_name}} npm run bump:version
|
|
38
|
-
- if: steps.packagejson.outputs.exists == 'true'
|
|
39
|
-
name: Create Pull Request with updated asset files including package.json
|
|
40
|
-
uses: peter-evans/create-pull-request@v3
|
|
41
|
-
with:
|
|
42
|
-
token: ${{ secrets.GH_TOKEN }}
|
|
43
|
-
commit-message: 'chore(release): ${{github.event.release.tag_name}}'
|
|
44
|
-
committer: asyncapi-bot <info@asyncapi.io>
|
|
45
|
-
author: asyncapi-bot <info@asyncapi.io>
|
|
46
|
-
title: 'chore(release): ${{github.event.release.tag_name}}'
|
|
47
|
-
body: 'Version bump in package.json for release [${{github.event.release.tag_name}}](${{github.event.release.html_url}})'
|
|
48
|
-
branch: version-bump/${{github.event.release.tag_name}}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
#This action is centrally managed in https://github.com/asyncapi/.github/
|
|
2
|
-
#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
|
|
3
|
-
|
|
4
|
-
#This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository
|
|
5
|
-
name: Notify slack
|
|
6
|
-
|
|
7
|
-
on:
|
|
8
|
-
|
|
9
|
-
issues:
|
|
10
|
-
types: [opened, reopened]
|
|
11
|
-
|
|
12
|
-
pull_request_target:
|
|
13
|
-
types: [opened, reopened, ready_for_review]
|
|
14
|
-
|
|
15
|
-
discussion:
|
|
16
|
-
types: [created]
|
|
17
|
-
|
|
18
|
-
jobs:
|
|
19
|
-
|
|
20
|
-
issue:
|
|
21
|
-
if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
|
|
22
|
-
name: On every new issue
|
|
23
|
-
runs-on: ubuntu-latest
|
|
24
|
-
steps:
|
|
25
|
-
- name: Convert markdown to slack markdown for issue
|
|
26
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
27
|
-
id: issuemarkdown
|
|
28
|
-
with:
|
|
29
|
-
text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
|
|
30
|
-
- name: Send info about issue
|
|
31
|
-
uses: rtCamp/action-slack-notify@v2
|
|
32
|
-
env:
|
|
33
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
|
|
34
|
-
SLACK_TITLE: 🐛 New Issue 🐛
|
|
35
|
-
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
|
|
36
|
-
MSG_MINIMAL: true
|
|
37
|
-
|
|
38
|
-
pull_request:
|
|
39
|
-
if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
|
|
40
|
-
name: On every new pull request
|
|
41
|
-
runs-on: ubuntu-latest
|
|
42
|
-
steps:
|
|
43
|
-
- name: Convert markdown to slack markdown for pull request
|
|
44
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
45
|
-
id: prmarkdown
|
|
46
|
-
with:
|
|
47
|
-
text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
|
|
48
|
-
- name: Send info about pull request
|
|
49
|
-
uses: rtCamp/action-slack-notify@v2
|
|
50
|
-
env:
|
|
51
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
|
|
52
|
-
SLACK_TITLE: 💪 New Pull Request 💪
|
|
53
|
-
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
|
|
54
|
-
MSG_MINIMAL: true
|
|
55
|
-
|
|
56
|
-
discussion:
|
|
57
|
-
if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
|
|
58
|
-
name: On every new pull request
|
|
59
|
-
runs-on: ubuntu-latest
|
|
60
|
-
steps:
|
|
61
|
-
- name: Convert markdown to slack markdown for pull request
|
|
62
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
63
|
-
id: discussionmarkdown
|
|
64
|
-
with:
|
|
65
|
-
text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
|
|
66
|
-
- name: Send info about pull request
|
|
67
|
-
uses: rtCamp/action-slack-notify@v2
|
|
68
|
-
env:
|
|
69
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
|
|
70
|
-
SLACK_TITLE: 💬 New Discussion 💬
|
|
71
|
-
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
|
|
72
|
-
MSG_MINIMAL: true
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#This action is centrally managed in https://github.com/asyncapi/.github/
|
|
2
|
-
#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
|
|
3
|
-
|
|
4
|
-
name: Lint PR title
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
|
|
8
|
-
pull_request_target:
|
|
9
|
-
types: [opened, reopened, synchronize, edited, ready_for_review]
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
|
|
13
|
-
lint:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- uses: amannn/action-semantic-pull-request@v3.2.5
|
|
17
|
-
env:
|
|
18
|
-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
19
|
-
with:
|
|
20
|
-
subjectPattern: ^(?![A-Z]).+$
|
|
21
|
-
subjectPatternError: |
|
|
22
|
-
The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character.
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
#This action is centrally managed in https://github.com/asyncapi/.github/
|
|
2
|
-
#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
|
|
3
|
-
|
|
4
|
-
#This action notifies community on slack whenever there is a new issue, PR or discussion started in given repository
|
|
5
|
-
name: Notify slack whenever TSC members are mentioned in GitHub
|
|
6
|
-
|
|
7
|
-
on:
|
|
8
|
-
issue_comment:
|
|
9
|
-
types:
|
|
10
|
-
- created
|
|
11
|
-
- edited
|
|
12
|
-
|
|
13
|
-
discussion_comment:
|
|
14
|
-
types:
|
|
15
|
-
- created
|
|
16
|
-
- edited
|
|
17
|
-
|
|
18
|
-
issues:
|
|
19
|
-
types:
|
|
20
|
-
- opened
|
|
21
|
-
- reopened
|
|
22
|
-
|
|
23
|
-
pull_request_target:
|
|
24
|
-
types:
|
|
25
|
-
- opened
|
|
26
|
-
- reopened
|
|
27
|
-
- ready_for_review
|
|
28
|
-
|
|
29
|
-
discussion:
|
|
30
|
-
types:
|
|
31
|
-
- created
|
|
32
|
-
- edited
|
|
33
|
-
|
|
34
|
-
jobs:
|
|
35
|
-
|
|
36
|
-
issue:
|
|
37
|
-
if: github.event_name == 'issues' && contains(github.event.issue.body, '@asyncapi/tsc_members')
|
|
38
|
-
name: On every new issue
|
|
39
|
-
runs-on: ubuntu-latest
|
|
40
|
-
steps:
|
|
41
|
-
- name: Convert markdown to slack markdown
|
|
42
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
43
|
-
id: issuemarkdown
|
|
44
|
-
with:
|
|
45
|
-
text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
|
|
46
|
-
- name: Send info about issue
|
|
47
|
-
uses: rtCamp/action-slack-notify@v2
|
|
48
|
-
env:
|
|
49
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
|
|
50
|
-
SLACK_TITLE: 🆘 New issue that requires TSC Members attention 🆘
|
|
51
|
-
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
|
|
52
|
-
MSG_MINIMAL: true
|
|
53
|
-
|
|
54
|
-
pull_request:
|
|
55
|
-
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members')
|
|
56
|
-
name: On every new pull request
|
|
57
|
-
runs-on: ubuntu-latest
|
|
58
|
-
steps:
|
|
59
|
-
- name: Convert markdown to slack markdown
|
|
60
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
61
|
-
id: prmarkdown
|
|
62
|
-
with:
|
|
63
|
-
text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
|
|
64
|
-
- name: Send info about pull request
|
|
65
|
-
uses: rtCamp/action-slack-notify@v2
|
|
66
|
-
env:
|
|
67
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
|
|
68
|
-
SLACK_TITLE: 🆘 New PR that requires TSC Members attention 🆘
|
|
69
|
-
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
|
|
70
|
-
MSG_MINIMAL: true
|
|
71
|
-
|
|
72
|
-
discussion:
|
|
73
|
-
if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members')
|
|
74
|
-
name: On every new discussion
|
|
75
|
-
runs-on: ubuntu-latest
|
|
76
|
-
steps:
|
|
77
|
-
- name: Convert markdown to slack markdown
|
|
78
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
79
|
-
id: discussionmarkdown
|
|
80
|
-
with:
|
|
81
|
-
text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
|
|
82
|
-
- name: Send info about pull request
|
|
83
|
-
uses: rtCamp/action-slack-notify@v2
|
|
84
|
-
env:
|
|
85
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
|
|
86
|
-
SLACK_TITLE: 🆘 New discussion that requires TSC Members attention 🆘
|
|
87
|
-
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
|
|
88
|
-
MSG_MINIMAL: true
|
|
89
|
-
|
|
90
|
-
issue_comment:
|
|
91
|
-
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }}
|
|
92
|
-
name: On every new comment in issue
|
|
93
|
-
runs-on: ubuntu-latest
|
|
94
|
-
steps:
|
|
95
|
-
- name: Convert markdown to slack markdown
|
|
96
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
97
|
-
id: issuemarkdown
|
|
98
|
-
with:
|
|
99
|
-
text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
|
|
100
|
-
- name: Send info about issue comment
|
|
101
|
-
uses: rtCamp/action-slack-notify@v2
|
|
102
|
-
env:
|
|
103
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
|
|
104
|
-
SLACK_TITLE: 🆘 New comment under existing issue that requires TSC Members attention 🆘
|
|
105
|
-
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
|
|
106
|
-
MSG_MINIMAL: true
|
|
107
|
-
|
|
108
|
-
pr_comment:
|
|
109
|
-
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members')
|
|
110
|
-
name: On every new comment in pr
|
|
111
|
-
runs-on: ubuntu-latest
|
|
112
|
-
steps:
|
|
113
|
-
- name: Convert markdown to slack markdown
|
|
114
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
115
|
-
id: prmarkdown
|
|
116
|
-
with:
|
|
117
|
-
text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
|
|
118
|
-
- name: Send info about PR comment
|
|
119
|
-
uses: rtCamp/action-slack-notify@v2
|
|
120
|
-
env:
|
|
121
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
|
|
122
|
-
SLACK_TITLE: 🆘 New comment under existing PR that requires TSC Members attention 🆘
|
|
123
|
-
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
|
|
124
|
-
MSG_MINIMAL: true
|
|
125
|
-
|
|
126
|
-
discussion_comment:
|
|
127
|
-
if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members')
|
|
128
|
-
name: On every new comment in discussion
|
|
129
|
-
runs-on: ubuntu-latest
|
|
130
|
-
steps:
|
|
131
|
-
- name: Convert markdown to slack markdown
|
|
132
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
133
|
-
id: discussionmarkdown
|
|
134
|
-
with:
|
|
135
|
-
text: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
|
|
136
|
-
- name: Send info about discussion comment
|
|
137
|
-
uses: rtCamp/action-slack-notify@v2
|
|
138
|
-
env:
|
|
139
|
-
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
|
|
140
|
-
SLACK_TITLE: 🆘 New comment under existing discussion that requires TSC Members attention 🆘
|
|
141
|
-
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
|
|
142
|
-
MSG_MINIMAL: true
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#This action is centrally managed in https://github.com/asyncapi/.github/
|
|
2
|
-
#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
|
|
3
|
-
name: 'Announce releases in different channels'
|
|
4
|
-
|
|
5
|
-
on:
|
|
6
|
-
release:
|
|
7
|
-
types:
|
|
8
|
-
- published
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
|
|
12
|
-
slack:
|
|
13
|
-
name: Slack - notify on every release
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- name: Convert markdown to slack markdown for issue
|
|
17
|
-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
|
|
18
|
-
id: markdown
|
|
19
|
-
with:
|
|
20
|
-
text: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}"
|
|
21
|
-
- name: Send info about release to Slack
|
|
22
|
-
uses: rtCamp/action-slack-notify@v2
|
|
23
|
-
env:
|
|
24
|
-
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }}
|
|
25
|
-
SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱💪🍾🎂
|
|
26
|
-
SLACK_MESSAGE: ${{steps.markdown.outputs.text}}
|
|
27
|
-
MSG_MINIMAL: true
|
|
28
|
-
|
|
29
|
-
twitter:
|
|
30
|
-
name: Twitter - notify on minor and major releases
|
|
31
|
-
runs-on: ubuntu-latest
|
|
32
|
-
steps:
|
|
33
|
-
- name: Checkout repo
|
|
34
|
-
uses: actions/checkout@v2
|
|
35
|
-
- name: Get version of last and previous release
|
|
36
|
-
uses: actions/github-script@v3
|
|
37
|
-
id: versions
|
|
38
|
-
with:
|
|
39
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
40
|
-
script: |
|
|
41
|
-
const query = `query($owner:String!, $name:String!) {
|
|
42
|
-
repository(owner:$owner, name:$name){
|
|
43
|
-
releases(first: 2, orderBy: {field: CREATED_AT, direction: DESC}) {
|
|
44
|
-
nodes {
|
|
45
|
-
name
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}`;
|
|
50
|
-
const variables = {
|
|
51
|
-
owner: context.repo.owner,
|
|
52
|
-
name: context.repo.repo
|
|
53
|
-
};
|
|
54
|
-
const { repository: { releases: { nodes } } } = await github.graphql(query, variables);
|
|
55
|
-
core.setOutput('lastver', nodes[0].name);
|
|
56
|
-
// In case of first release in the package, there is no such thing as previous error, so we set info about previous version only once we have it
|
|
57
|
-
// We should tweet about the release no matter of the type as it is initial release
|
|
58
|
-
if (nodes.length != 1) core.setOutput('previousver', nodes[1].name);
|
|
59
|
-
- name: Identify release type
|
|
60
|
-
id: releasetype
|
|
61
|
-
# if previousver is not provided then this steps just logs information about missing version, no errors
|
|
62
|
-
run: echo "::set-output name=type::$(npx -q -p semver-diff-cli semver-diff ${{steps.versions.outputs.previousver}} ${{steps.versions.outputs.lastver}})"
|
|
63
|
-
- name: Get name of the person that is behind the newly released version
|
|
64
|
-
id: author
|
|
65
|
-
run: echo "::set-output name=name::$(git log -1 --pretty=format:'%an')"
|
|
66
|
-
- name: Publish information about the release to Twitter # tweet only if detected version change is not a patch
|
|
67
|
-
# tweet goes out even if the type is not major or minor but "You need provide version number to compare."
|
|
68
|
-
# it is ok, it just means we did not identify previous version as we are tweeting out information about the release for the first time
|
|
69
|
-
if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same
|
|
70
|
-
uses: m1ner79/Github-Twittction@v1.0.1
|
|
71
|
-
with:
|
|
72
|
-
twitter_status: "Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱💪🍾🎂\n\nThank you for the contribution ${{ steps.author.outputs.name }} ${{github.event.release.html_url}}"
|
|
73
|
-
twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }}
|
|
74
|
-
twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
|
|
75
|
-
twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
|
|
76
|
-
twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#This action is centrally managed in https://github.com/asyncapi/.github/
|
|
2
|
-
#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
|
|
3
|
-
|
|
4
|
-
name: 'Sentiment Analysis'
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
issue_comment:
|
|
8
|
-
types:
|
|
9
|
-
- created
|
|
10
|
-
- edited
|
|
11
|
-
issues:
|
|
12
|
-
types:
|
|
13
|
-
- opened
|
|
14
|
-
- edited
|
|
15
|
-
pull_request:
|
|
16
|
-
types:
|
|
17
|
-
- opened
|
|
18
|
-
- edited
|
|
19
|
-
pull_request_review:
|
|
20
|
-
types:
|
|
21
|
-
- submitted
|
|
22
|
-
- edited
|
|
23
|
-
pull_request_review_comment:
|
|
24
|
-
types:
|
|
25
|
-
- created
|
|
26
|
-
- edited
|
|
27
|
-
jobs:
|
|
28
|
-
test:
|
|
29
|
-
name: Checking sentiments
|
|
30
|
-
runs-on: ubuntu-latest
|
|
31
|
-
steps:
|
|
32
|
-
- uses: actions/checkout@v2
|
|
33
|
-
- name: Check sentiment
|
|
34
|
-
uses: derberg/code-of-conduct-sentiment-analysis-github-action@v1
|
|
35
|
-
id: sentiments
|
|
36
|
-
with:
|
|
37
|
-
gcp_key: ${{ secrets.GCP_KEY_SENTIMENT }}
|
|
38
|
-
- uses: someimportantcompany/github-actions-slack-message@v1
|
|
39
|
-
# this step runs only if sentiment is a negative number
|
|
40
|
-
if: steps.sentiments.outputs.sentiment < -0.6
|
|
41
|
-
with:
|
|
42
|
-
webhook-url: ${{ secrets.SLACK_SENTIMENTS }}
|
|
43
|
-
text: Here ${{steps.sentiments.outputs.source}} you can find a potential negative text that requires your attention as the sentiment analysis score is ${{steps.sentiments.outputs.sentiment}}
|
|
44
|
-
color: orange
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#This action is centrally managed in https://github.com/asyncapi/.github/
|
|
2
|
-
#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
|
|
3
|
-
|
|
4
|
-
name: Manage stale issues and PRs
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
schedule:
|
|
8
|
-
- cron: "0 0 * * *"
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
stale:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/stale@v4.0.0
|
|
15
|
-
with:
|
|
16
|
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
17
|
-
stale-issue-message: |
|
|
18
|
-
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
|
|
19
|
-
|
|
20
|
-
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
|
|
21
|
-
|
|
22
|
-
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under [open governance model](https://github.com/asyncapi/community/blob/master/CHARTER.md).
|
|
23
|
-
|
|
24
|
-
Let us figure out together how to push this issue forward. Connect with us through [one of many communication channels](https://github.com/asyncapi/community/issues/1) we established here.
|
|
25
|
-
|
|
26
|
-
Thank you for your patience :heart:
|
|
27
|
-
stale-pr-message: |
|
|
28
|
-
This pull request has been automatically marked as stale because it has not had recent activity :sleeping:
|
|
29
|
-
|
|
30
|
-
It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.
|
|
31
|
-
|
|
32
|
-
There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under [open governance model](https://github.com/asyncapi/community/blob/master/CHARTER.md).
|
|
33
|
-
|
|
34
|
-
Let us figure out together how to push this pull request forward. Connect with us through [one of many communication channels](https://github.com/asyncapi/community/issues/1) we established here.
|
|
35
|
-
|
|
36
|
-
Thank you for your patience :heart:
|
|
37
|
-
days-before-stale: 120
|
|
38
|
-
days-before-close: 120
|
|
39
|
-
stale-issue-label: stale
|
|
40
|
-
stale-pr-label: stale
|
|
41
|
-
exempt-issue-labels: keep-open
|
|
42
|
-
exempt-pr-labels: keep-open
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#This action is centrally managed in https://github.com/asyncapi/.github/
|
|
2
|
-
#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
|
|
3
|
-
|
|
4
|
-
name: Welcome first time contributors
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
pull_request_target:
|
|
8
|
-
types:
|
|
9
|
-
- opened
|
|
10
|
-
issues:
|
|
11
|
-
types:
|
|
12
|
-
- opened
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
welcome:
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/github-script@v3
|
|
19
|
-
with:
|
|
20
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
-
script: |
|
|
22
|
-
const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/.github/blob/master/git-workflow.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
|
|
23
|
-
const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
|
|
24
|
-
if (!issueMessage && !prMessage) {
|
|
25
|
-
throw new Error('Action must have at least one of issue-message or pr-message set');
|
|
26
|
-
}
|
|
27
|
-
const isIssue = !!context.payload.issue;
|
|
28
|
-
let isFirstContribution;
|
|
29
|
-
if (isIssue) {
|
|
30
|
-
const query = `query($owner:String!, $name:String!, $contributer:String!) {
|
|
31
|
-
repository(owner:$owner, name:$name){
|
|
32
|
-
issues(first: 1, filterBy: {createdBy:$contributer}){
|
|
33
|
-
totalCount
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}`;
|
|
37
|
-
const variables = {
|
|
38
|
-
owner: context.repo.owner,
|
|
39
|
-
name: context.repo.repo,
|
|
40
|
-
contributer: context.payload.sender.login
|
|
41
|
-
};
|
|
42
|
-
const { repository: { issues: { totalCount } } } = await github.graphql(query, variables);
|
|
43
|
-
isFirstContribution = totalCount === 1;
|
|
44
|
-
} else {
|
|
45
|
-
const query = `query($qstr: String!) {
|
|
46
|
-
search(query: $qstr, type: ISSUE, first: 1) {
|
|
47
|
-
issueCount
|
|
48
|
-
}
|
|
49
|
-
}`;
|
|
50
|
-
const variables = {
|
|
51
|
-
"qstr": `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${context.payload.sender.login}`,
|
|
52
|
-
};
|
|
53
|
-
const { search: { issueCount } } = await github.graphql(query, variables);
|
|
54
|
-
isFirstContribution = issueCount === 1;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (!isFirstContribution) {
|
|
58
|
-
console.log(`Not the users first contribution.`);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const message = isIssue ? issueMessage : prMessage;
|
|
62
|
-
// Add a comment to the appropriate place
|
|
63
|
-
if (isIssue) {
|
|
64
|
-
const issueNumber = context.payload.issue.number;
|
|
65
|
-
console.log(`Adding message: ${message} to issue #${issueNumber}`);
|
|
66
|
-
await github.issues.createComment({
|
|
67
|
-
owner: context.payload.repository.owner.login,
|
|
68
|
-
repo: context.payload.repository.name,
|
|
69
|
-
issue_number: issueNumber,
|
|
70
|
-
body: message
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
const pullNumber = context.payload.pull_request.number;
|
|
75
|
-
console.log(`Adding message: ${message} to pull request #${pullNumber}`);
|
|
76
|
-
await github.pulls.createReview({
|
|
77
|
-
owner: context.payload.repository.owner.login,
|
|
78
|
-
repo: context.payload.repository.name,
|
|
79
|
-
pull_number: pullNumber,
|
|
80
|
-
body: message,
|
|
81
|
-
event: 'COMMENT'
|
|
82
|
-
});
|
|
83
|
-
}
|
package/CODEOWNERS
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# This file provides an overview of code owners in this repository.
|
|
2
|
-
|
|
3
|
-
# Each line is a file pattern followed by one or more owners.
|
|
4
|
-
# The last matching pattern has the most precedence.
|
|
5
|
-
# For more details, read the following article on GitHub: https://help.github.com/articles/about-codeowners/.
|
|
6
|
-
|
|
7
|
-
# The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file.
|
|
8
|
-
* @fmvilas @magicmatatjahu @derberg @github-actions[bot]
|
package/lib/helpers.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
const _ = require('lodash');
|
|
2
|
-
const yaml = require('js-yaml');
|
|
3
|
-
const helpers = module.exports;
|
|
4
|
-
|
|
5
|
-
helpers.serialize = (text) => {
|
|
6
|
-
if (typeof text === 'object') {
|
|
7
|
-
return {
|
|
8
|
-
isYAML: false,
|
|
9
|
-
parsed: text,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
const maybeJSON = JSON.parse(text);
|
|
15
|
-
if (typeof maybeJSON === 'object') {
|
|
16
|
-
return {
|
|
17
|
-
isYAML: false,
|
|
18
|
-
parsed: maybeJSON,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// if `maybeJSON` is object, then we have 100% sure that we operate on JSON,
|
|
23
|
-
// but if it's `string` then we have option that it can be YAML but it doesn't have to be
|
|
24
|
-
return {
|
|
25
|
-
isYAML: true,
|
|
26
|
-
parsed: yaml.safeLoad(text)
|
|
27
|
-
};
|
|
28
|
-
} catch (e) {
|
|
29
|
-
try {
|
|
30
|
-
// try to parse again YAML, because the text itself may not have a JSON representation and cannot be represented as a JSON object/string
|
|
31
|
-
return {
|
|
32
|
-
isYAML: true,
|
|
33
|
-
parsed: yaml.safeLoad(text)
|
|
34
|
-
};
|
|
35
|
-
} catch (err) {
|
|
36
|
-
throw new Error('AsyncAPI document must be a valid JSON or YAML document.');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
helpers.dotsToSlashes = topic => topic.replace(/\./g, '/');
|
|
42
|
-
|
|
43
|
-
helpers.eventToChannel = event => {
|
|
44
|
-
const out = {};
|
|
45
|
-
if (event.receive) {
|
|
46
|
-
out.publish = {
|
|
47
|
-
message: {
|
|
48
|
-
oneOf: event.receive
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (event.send) {
|
|
53
|
-
out.subscribe = {
|
|
54
|
-
message: {
|
|
55
|
-
oneOf: event.send
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return out;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
helpers.streamToChannel = event => {
|
|
64
|
-
const out = {};
|
|
65
|
-
if (event.read) {
|
|
66
|
-
out.publish = {
|
|
67
|
-
message: {
|
|
68
|
-
oneOf: event.read
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (event.write) {
|
|
73
|
-
out.subscribe = {
|
|
74
|
-
message: {
|
|
75
|
-
oneOf: event.write
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return out;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const objectToSchema = obj => {
|
|
84
|
-
const schema = { type: 'object', properties: {} };
|
|
85
|
-
_.each(obj, (prop, propName) => {
|
|
86
|
-
schema.properties[propName] = prop;
|
|
87
|
-
});
|
|
88
|
-
return obj;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
helpers.convertMessage = message => {
|
|
92
|
-
if (message.oneOf) {
|
|
93
|
-
message.oneOf.forEach(m => {
|
|
94
|
-
if (m.protocolInfo) {
|
|
95
|
-
m.bindings = m.protocolInfo;
|
|
96
|
-
delete m.protocolInfo;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (m.headers) m.headers = objectToSchema(m.headers);
|
|
100
|
-
});
|
|
101
|
-
} else {
|
|
102
|
-
if (message.protocolInfo) {
|
|
103
|
-
message.bindings = message.protocolInfo;
|
|
104
|
-
delete message.protocolInfo;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (message.headers) message.headers = objectToSchema(message.headers);
|
|
108
|
-
}
|
|
109
|
-
}
|