@asyncapi/converter 0.6.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.
Files changed (39) hide show
  1. package/.github/workflows/automerge-orphans.yml +63 -0
  2. package/.github/workflows/automerge.yml +47 -0
  3. package/.github/workflows/bump.yml +32 -0
  4. package/.github/workflows/if-go-pr-testing.yml +58 -0
  5. package/.github/workflows/if-nodejs-pr-testing.yml +48 -0
  6. package/.github/workflows/if-nodejs-release.yml +70 -0
  7. package/.github/workflows/if-nodejs-version-bump.yml +48 -0
  8. package/.github/workflows/issues-prs-notifications.yml +72 -0
  9. package/.github/workflows/lint-pr-title.yml +22 -0
  10. package/.github/workflows/release-announcements.yml +76 -0
  11. package/.github/workflows/sentiment-analysis.yml +44 -0
  12. package/.github/workflows/stale-issues-prs.yml +30 -0
  13. package/.github/workflows/welcome-first-time-contrib.yml +34 -0
  14. package/README.md +60 -0
  15. package/cli.js +47 -0
  16. package/lib/helpers.js +91 -0
  17. package/lib/index.js +204 -0
  18. package/package.json +70 -0
  19. package/test/index.js +194 -0
  20. package/test/input/1.0.0/streetlights.yml +120 -0
  21. package/test/input/1.1.0/streetlights.yml +120 -0
  22. package/test/input/1.2.0/gitter-streaming.yml +140 -0
  23. package/test/input/1.2.0/slack-rtm.yml +876 -0
  24. package/test/input/1.2.0/streetlights.yml +120 -0
  25. package/test/input/2.0.0/streetlights.yml +113 -0
  26. package/test/input/2.0.0-rc1/streetlights.yml +109 -0
  27. package/test/input/2.0.0-rc2/streetlights.yml +113 -0
  28. package/test/input/2.1.0/streetlights.yml +113 -0
  29. package/test/output/2.0.0/gitter-streaming.yml +137 -0
  30. package/test/output/2.0.0/slack-rtm.yml +879 -0
  31. package/test/output/2.0.0/streetlights.yml +113 -0
  32. package/test/output/2.0.0-rc1/gitter-streaming.yml +137 -0
  33. package/test/output/2.0.0-rc1/slack-rtm.yml +879 -0
  34. package/test/output/2.0.0-rc1/streetlights.yml +109 -0
  35. package/test/output/2.0.0-rc2/gitter-streaming.yml +137 -0
  36. package/test/output/2.0.0-rc2/slack-rtm.yml +879 -0
  37. package/test/output/2.0.0-rc2/streetlights.yml +113 -0
  38. package/test/output/2.1.0/streetlights.yml +113 -0
  39. package/test/output/2.2.0/streetlights.yml +113 -0
@@ -0,0 +1,63 @@
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: 'Notify on failing automerge'
5
+
6
+ on:
7
+ schedule:
8
+ - cron: "0 0 * * *"
9
+
10
+ jobs:
11
+ identify-orphans:
12
+ name: Find orphans and notify
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Get list of orphans
16
+ uses: actions/github-script@v3
17
+ id: orphans
18
+ with:
19
+ github-token: ${{ secrets.GITHUB_TOKEN }}
20
+ script: |
21
+ const query = `query($owner:String!, $name:String!) {
22
+ repository(owner:$owner, name:$name){
23
+ pullRequests(first: 100, states: OPEN){
24
+ nodes{
25
+ title
26
+ url
27
+ author {
28
+ resourcePath
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }`;
34
+ const variables = {
35
+ owner: context.repo.owner,
36
+ name: context.repo.repo
37
+ };
38
+ const { repository: { pullRequests: { nodes } } } = await github.graphql(query, variables);
39
+
40
+ let orphans = nodes.filter( (pr) => pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot')
41
+
42
+ if (orphans.length) {
43
+ core.setOutput('found', 'true');
44
+ //Yes, this is very naive approach to assume there is just one PR causing issues, there can be a case that more PRs are affected the same day
45
+ //The thing is that handling multiple PRs will increase a complexity in this PR that in my opinion we should avoid
46
+ //The other PRs will be reported the next day the action runs, or person that checks first url will notice the other ones
47
+ core.setOutput('url', orphans[0].url);
48
+ core.setOutput('title', orphans[0].title);
49
+ }
50
+ - if: steps.orphans.outputs.found == 'true'
51
+ name: Convert markdown to slack markdown
52
+ uses: LoveToKnow/slackify-markdown-action@v1.0.0
53
+ id: issuemarkdown
54
+ with:
55
+ text: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})"
56
+ - if: steps.orphans.outputs.found == 'true'
57
+ name: Send info about orphan to slack
58
+ uses: rtCamp/action-slack-notify@v2
59
+ env:
60
+ SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
61
+ SLACK_TITLE: 🚨 Not merged PR that should be automerged 🚨
62
+ SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
63
+ MSG_MINIMAL: true
@@ -0,0 +1,47 @@
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: Automerge release bump PR
5
+
6
+ on:
7
+ pull_request_target:
8
+ types:
9
+ - labeled
10
+ - unlabeled
11
+ - synchronize
12
+ - opened
13
+ - edited
14
+ - ready_for_review
15
+ - reopened
16
+ - unlocked
17
+ pull_request_review:
18
+ types:
19
+ - submitted
20
+
21
+ jobs:
22
+
23
+ autoapprove:
24
+ if: github.event.pull_request.draft == false
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - name: Autoapproving
28
+ uses: hmarr/auto-approve-action@v2
29
+ if: github.actor == ('asyncapi-bot' || github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') && !contains(github.event.pull_request.labels.*.name, 'released')
30
+ with:
31
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
32
+
33
+ automerge:
34
+ needs: [autoapprove]
35
+ runs-on: ubuntu-latest
36
+ steps:
37
+ - name: Automerging
38
+ uses: pascalgn/automerge-action@v0.13.0
39
+ if: github.actor == 'asyncapi-bot' || github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
40
+ env:
41
+ GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
42
+ GITHUB_LOGIN: asyncapi-bot
43
+ MERGE_LABELS: ""
44
+ MERGE_METHOD: "squash"
45
+ MERGE_COMMIT_MESSAGE: "pull-request-title"
46
+ MERGE_RETRIES: "20"
47
+ MERGE_RETRY_SLEEP: "30000"
@@ -0,0 +1,32 @@
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
+ #Purpose of this action is to update npm package in libraries that use it. It is like dependabot for asyncapi npm modules only.
5
+ #It runs in a repo after merge of release commit and searches for other packages that use released package. Every found package gets updated with lates version
6
+
7
+ name: Bump package version in dependent repos - if Node project
8
+
9
+ on:
10
+ #It cannot run on release event as when release is created then version is not yet bumped in package.json
11
+ #This means we cannot extract easily latest version and have a risk that package is not yet on npm
12
+ push:
13
+ branches:
14
+ - master
15
+
16
+ jobs:
17
+ bump:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - name: Checkout repo
21
+ uses: actions/checkout@v2
22
+ - name: Check if Node.js project and has package.json
23
+ id: packagejson
24
+ run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
25
+ - if: steps.packagejson.outputs.exists == 'true' && startsWith(github.event.commits[0].message, 'chore(release):')
26
+ name: Bumping latest version of this package in other repositories
27
+ uses: derberg/npm-dependency-manager-for-your-github-org@v3
28
+ with:
29
+ github_token: ${{ secrets.GH_TOKEN }}
30
+ committer_username: asyncapi-bot
31
+ committer_email: info@asyncapi.io
32
+ repos_to_ignore: html-template #this is temporary until react component releases 1.0, then it can be removed
@@ -0,0 +1,58 @@
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 go.mod file in the root of the project
4
+ name: PR testing - if Go project
5
+
6
+ on:
7
+ pull_request:
8
+ types: [opened, reopened, synchronize, ready_for_review]
9
+
10
+ jobs:
11
+ lint:
12
+ if: github.event.pull_request.draft == false
13
+ name: lint
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v2
18
+ - name: Check if Go project and has go.mod
19
+ id: gomod
20
+ run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
21
+ shell: bash
22
+ - if: steps.gomod.outputs.exists == 'true'
23
+ name: Setup Go
24
+ uses: actions/setup-go@v2.1.3
25
+ with:
26
+ go-version: 1.16
27
+ - if: steps.gomod.outputs.exists == 'true'
28
+ name: golangci-lint
29
+ uses: golangci/golangci-lint-action@v2 # golangci-lint version extracted from go.mod. `latest` if missing.
30
+ with:
31
+ skip-go-installation: true # we wanna control the version of Go in use
32
+
33
+ test:
34
+ if: github.event.pull_request.draft == false
35
+ name: ${{ matrix.os }}
36
+ runs-on: ${{ matrix.os }}
37
+ strategy:
38
+ matrix:
39
+ os: [ubuntu-latest, macos-latest, windows-latest]
40
+ steps:
41
+ - name: Checkout repository
42
+ uses: actions/checkout@v2
43
+ - name: Check if Go project and has go.mod
44
+ id: gomod
45
+ run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
46
+ shell: bash
47
+ - if: steps.gomod.outputs.exists == 'true'
48
+ name: Setup Go
49
+ uses: actions/setup-go@v2.1.3
50
+ with:
51
+ go-version: 1.16
52
+ - if: steps.gomod.outputs.exists == 'true'
53
+ name: Build
54
+ run: go build -v ./...
55
+ - if: steps.gomod.outputs.exists == 'true'
56
+ name: Test
57
+ run: go test -v ./...
58
+
@@ -0,0 +1,48 @@
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: PR testing - if Node project
5
+
6
+ on:
7
+ pull_request:
8
+ types: [opened, reopened, synchronize, ready_for_review]
9
+
10
+ jobs:
11
+ test:
12
+ if: github.event.pull_request.draft == false
13
+ name: ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ strategy:
16
+ matrix:
17
+ os: [ubuntu-latest, macos-latest, windows-latest]
18
+ steps:
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v2
21
+ - name: Check if Node.js project and has package.json
22
+ id: packagejson
23
+ run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
24
+ shell: bash
25
+ - if: steps.packagejson.outputs.exists == 'true'
26
+ name: Setup Node.js
27
+ uses: actions/setup-node@v1
28
+ with:
29
+ node-version: 14
30
+ - if: steps.packagejson.outputs.exists == 'true'
31
+ name: Install dependencies
32
+ id: first-installation
33
+ run: npm install --loglevel verbose
34
+ continue-on-error: true
35
+ - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true'
36
+ name: Clear NPM cache and install deps again
37
+ run: |
38
+ npm cache clean --force
39
+ npm install --loglevel verbose
40
+ - if: steps.packagejson.outputs.exists == 'true'
41
+ name: Test
42
+ run: npm test
43
+ - if: steps.packagejson.outputs.exists == 'true'
44
+ name: Run linter
45
+ run: npm run lint
46
+ - if: steps.packagejson.outputs.exists == 'true'
47
+ name: Run release assets generation to make sure PR does not break it
48
+ run: npm run generate:assets
@@ -0,0 +1,70 @@
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: Release - if Node project
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - master
10
+ # below lines are not enough to have release supported for these branches
11
+ # make sure configuration of `semantic-release` package mentiones these branches
12
+ - next
13
+ - '**-release'
14
+
15
+ jobs:
16
+
17
+ test:
18
+ name: Test on ${{ matrix.os }}
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ matrix:
22
+ os: [ubuntu-latest, macos-latest, windows-latest]
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@v2
26
+ - name: Check if Node.js project and has package.json
27
+ id: packagejson
28
+ run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
29
+ shell: bash
30
+ - if: steps.packagejson.outputs.exists == 'true'
31
+ name: Setup Node.js
32
+ uses: actions/setup-node@v1
33
+ with:
34
+ node-version: 14
35
+ - if: steps.packagejson.outputs.exists == 'true'
36
+ name: Install dependencies
37
+ run: npm install
38
+ - if: steps.packagejson.outputs.exists == 'true'
39
+ name: Run test
40
+ run: npm test
41
+
42
+ release:
43
+ needs: test
44
+ name: Publish to NPM and GitHub
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - name: Checkout repository
48
+ uses: actions/checkout@v2
49
+ - name: Check if Node.js project and has package.json
50
+ id: packagejson
51
+ run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
52
+ - if: steps.packagejson.outputs.exists == 'true'
53
+ name: Setup Node.js
54
+ uses: actions/setup-node@v1
55
+ with:
56
+ node-version: 14
57
+ - if: steps.packagejson.outputs.exists == 'true'
58
+ name: Install dependencies
59
+ run: npm install
60
+ - if: steps.packagejson.outputs.exists == 'true'
61
+ name: Release to NPM and GitHub
62
+ id: release
63
+ env:
64
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
65
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
66
+ GIT_AUTHOR_NAME: asyncapi-bot
67
+ GIT_AUTHOR_EMAIL: info@asyncapi.io
68
+ GIT_COMMITTER_NAME: asyncapi-bot
69
+ GIT_COMMITTER_EMAIL: info@asyncapi.io
70
+ run: npm run release
@@ -0,0 +1,48 @@
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}}
@@ -0,0 +1,72 @@
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: [opened]
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
@@ -0,0 +1,22 @@
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.
@@ -0,0 +1,76 @@
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 }}
@@ -0,0 +1,44 @@
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
@@ -0,0 +1,30 @@
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@v1.1.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
+ It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
20
+ Thank you for your contributions :heart:
21
+ stale-pr-message: |
22
+ This pull request has been automatically marked as stale because it has not had recent activity :sleeping:
23
+ It will be closed in 60 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.
24
+ Thank you for your contributions :heart:
25
+ days-before-stale: 60
26
+ days-before-close: 60
27
+ stale-issue-label: stale
28
+ stale-pr-label: stale
29
+ exempt-issue-label: keep-open
30
+ exempt-pr-label: keep-open
@@ -0,0 +1,34 @@
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
+ #########
5
+ #disabled because of https://github.com/asyncapi/.github/issues/73
6
+ #########
7
+
8
+ # name: Welcome first time contributors
9
+
10
+ # on:
11
+ # pull_request_target:
12
+ # types:
13
+ # - opened
14
+ # issues:
15
+ # types:
16
+ # - opened
17
+
18
+ # jobs:
19
+ # welcome:
20
+ # runs-on: ubuntu-latest
21
+ # steps:
22
+ # - uses: actions/first-interaction@v1
23
+ # with:
24
+ # repo-token: ${{ secrets.GITHUB_TOKEN }}
25
+ # issue-message: |
26
+ # Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/.github/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.
27
+
28
+ # 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).
29
+
30
+
31
+ # pr-message: |
32
+ # Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/.github/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.
33
+
34
+ # 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).