├── .all-contributorsrc ├── .asyncapi-tool ├── .github └── workflows │ ├── add-good-first-issue-labels.yml │ ├── automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml │ ├── automerge-for-humans-merging.yml │ ├── automerge-for-humans-remove-ready-to-merge-label-on-edit.yml │ ├── automerge-orphans.yml │ ├── automerge.yml │ ├── autoupdate.yml │ ├── bounty-program-commands.yml │ ├── bump.yml │ ├── help-command.yml │ ├── if-docker-pr-testing.yml │ ├── if-nodejs-pr-testing.yml │ ├── if-nodejs-release.yml │ ├── if-nodejs-version-bump.yml │ ├── issues-prs-notifications.yml │ ├── lint-pr-title.yml │ ├── notify-tsc-members-mention.yml │ ├── please-take-a-look-command.yml │ ├── release-announcements.yml │ ├── release-docker.yml │ ├── scripts │ ├── README.md │ └── mailchimp │ │ ├── htmlContent.js │ │ ├── index.js │ │ ├── package-lock.json │ │ └── package.json │ ├── stale-issues-prs.yml │ ├── test-action.yml │ ├── update-pr.yml │ └── welcome-first-time-contrib.yml ├── .gitignore ├── .releaserc ├── .sonarcloud.properties ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── action.yml ├── bump-test.sh ├── entrypoint.sh ├── package-lock.json ├── package.json └── test ├── asyncapi.yml ├── bundle ├── asyncapi.yaml ├── features.yaml └── messages.yaml ├── dummy.yml ├── specification-invalid.yml └── unoptimized.yml /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "derberg", 10 | "name": "Lukasz Gornicki", 11 | "avatar_url": "https://avatars.githubusercontent.com/u/6995927?v=4", 12 | "profile": "https://www.brainfart.dev/", 13 | "contributions": [ 14 | "code", 15 | "maintenance", 16 | "infra", 17 | "review" 18 | ] 19 | }, 20 | { 21 | "login": "magicmatatjahu", 22 | "name": "Maciej Urbańczyk", 23 | "avatar_url": "https://avatars.githubusercontent.com/u/20404945?v=4", 24 | "profile": "https://github.com/magicmatatjahu", 25 | "contributions": [ 26 | "review" 27 | ] 28 | }, 29 | { 30 | "login": "victormartingarcia", 31 | "name": "Victor", 32 | "avatar_url": "https://avatars.githubusercontent.com/u/659832?v=4", 33 | "profile": "https://www.victormartingarcia.com", 34 | "contributions": [ 35 | "code" 36 | ] 37 | }, 38 | { 39 | "login": "HUTCHHUTCHHUTCH", 40 | "name": "HUTCHHUTCHHUTCH", 41 | "avatar_url": "https://avatars.githubusercontent.com/u/55915170?v=4", 42 | "profile": "https://github.com/HUTCHHUTCHHUTCH", 43 | "contributions": [ 44 | "infra" 45 | ] 46 | }, 47 | { 48 | "login": "pioneer2k", 49 | "name": "Thomas Heyer", 50 | "avatar_url": "https://avatars.githubusercontent.com/u/32297829?v=4", 51 | "profile": "https://github.com/pioneer2k", 52 | "contributions": [ 53 | "infra" 54 | ] 55 | }, 56 | { 57 | "login": "Shurtu-gal", 58 | "name": "Ashish Padhy", 59 | "avatar_url": "https://avatars.githubusercontent.com/u/100484401?v=4", 60 | "profile": "http://ashishpadhy.live", 61 | "contributions": [ 62 | "code", 63 | "test", 64 | "doc", 65 | "ideas" 66 | ] 67 | } 68 | ], 69 | "contributorsPerLine": 7, 70 | "projectName": "github-action-for-cli", 71 | "projectOwner": "asyncapi", 72 | "repoType": "github", 73 | "repoHost": "https://github.com", 74 | "commitConvention": "angular", 75 | "commitType": "docs" 76 | } 77 | -------------------------------------------------------------------------------- /.asyncapi-tool: -------------------------------------------------------------------------------- 1 | title: GitHub Action for CLI 2 | filters: 3 | technology: 4 | - AsyncAPI CLI 5 | categories: 6 | - github-action 7 | -------------------------------------------------------------------------------- /.github/workflows/add-good-first-issue-labels.yml: -------------------------------------------------------------------------------- 1 | # This workflow 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 workflow is to enable anyone to label issue with 'Good First Issue' and 'area/*' with a single command. 5 | name: Add 'Good First Issue' and 'area/*' labels # if proper comment added 6 | 7 | on: 8 | issue_comment: 9 | types: 10 | - created 11 | 12 | jobs: 13 | add-labels: 14 | if: ${{(!github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot') && (contains(github.event.comment.body, '/good-first-issue') || contains(github.event.comment.body, '/gfi' ))}} 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Add label 18 | uses: actions/github-script@v6 19 | with: 20 | github-token: ${{ secrets.GH_TOKEN }} 21 | script: | 22 | const areas = ['javascript', 'typescript', 'java' , 'go', 'docs', 'ci-cd', 'design']; 23 | const words = context.payload.comment.body.trim().split(" "); 24 | const areaIndex = words.findIndex((word)=> word === '/gfi' || word === '/good-first-issue') + 1 25 | let area = words[areaIndex]; 26 | switch(area){ 27 | case 'ts': 28 | area = 'typescript'; 29 | break; 30 | case 'js': 31 | area = 'javascript'; 32 | break; 33 | case 'markdown': 34 | area = 'docs'; 35 | break; 36 | } 37 | if(!areas.includes(area)){ 38 | const message = `Hey @${context.payload.sender.login}, your message doesn't follow the requirements, you can try \`/help\`.` 39 | 40 | await github.rest.issues.createComment({ 41 | issue_number: context.issue.number, 42 | owner: context.repo.owner, 43 | repo: context.repo.repo, 44 | body: message 45 | }) 46 | } else { 47 | 48 | // remove area if there is any before adding new labels. 49 | const currentLabels = (await github.rest.issues.listLabelsOnIssue({ 50 | issue_number: context.issue.number, 51 | owner: context.repo.owner, 52 | repo: context.repo.repo, 53 | })).data.map(label => label.name); 54 | 55 | const shouldBeRemoved = currentLabels.filter(label => (label.startsWith('area/') && !label.endsWith(area))); 56 | shouldBeRemoved.forEach(label => { 57 | github.rest.issues.deleteLabel({ 58 | owner: context.repo.owner, 59 | repo: context.repo.repo, 60 | name: label, 61 | }); 62 | }); 63 | 64 | // Add new labels. 65 | github.rest.issues.addLabels({ 66 | issue_number: context.issue.number, 67 | owner: context.repo.owner, 68 | repo: context.repo.repo, 69 | labels: ['good first issue', `area/${area}`] 70 | }); 71 | } 72 | -------------------------------------------------------------------------------- /.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml: -------------------------------------------------------------------------------- 1 | # This workflow 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 workflow is to enable anyone to label PR with the following labels: 5 | # `ready-to-merge` and `do-not-merge` labels to get stuff merged or blocked from merging 6 | # `autoupdate` to keep a branch up-to-date with the target branch 7 | 8 | name: Label PRs # if proper comment added 9 | 10 | on: 11 | issue_comment: 12 | types: 13 | - created 14 | 15 | jobs: 16 | add-ready-to-merge-label: 17 | if: > 18 | github.event.issue.pull_request && 19 | github.event.issue.state != 'closed' && 20 | github.actor != 'asyncapi-bot' && 21 | ( 22 | contains(github.event.comment.body, '/ready-to-merge') || 23 | contains(github.event.comment.body, '/rtm' ) 24 | ) 25 | 26 | runs-on: ubuntu-latest 27 | steps: 28 | - name: Add ready-to-merge label 29 | uses: actions/github-script@v6 30 | with: 31 | github-token: ${{ secrets.GH_TOKEN }} 32 | script: | 33 | const prDetailsUrl = context.payload.issue.pull_request.url; 34 | const { data: pull } = await github.request(prDetailsUrl); 35 | const { draft: isDraft} = pull; 36 | if(!isDraft) { 37 | console.log('adding ready-to-merge label...'); 38 | github.rest.issues.addLabels({ 39 | issue_number: context.issue.number, 40 | owner: context.repo.owner, 41 | repo: context.repo.repo, 42 | labels: ['ready-to-merge'] 43 | }) 44 | } 45 | 46 | const { data: comparison } = 47 | await github.rest.repos.compareCommitsWithBasehead({ 48 | owner: pull.head.repo.owner.login, 49 | repo: pull.head.repo.name, 50 | basehead: `${pull.base.label}...${pull.head.label}`, 51 | }); 52 | if (comparison.behind_by !== 0 && pull.mergeable_state === 'behind') { 53 | console.log(`This branch is behind the target by ${comparison.behind_by} commits`) 54 | console.log('adding out-of-date comment...'); 55 | github.rest.issues.createComment({ 56 | issue_number: context.issue.number, 57 | owner: context.repo.owner, 58 | repo: context.repo.repo, 59 | body: `Hello, @${{ github.actor }}! 👋🏼 60 | This PR is not up to date with the base branch and can't be merged. 61 | Please update your branch manually with the latest version of the base branch. 62 | PRO-TIP: To request an update from the upstream branch, simply comment \`/u\` or \`/update\` and our bot will handle the update operation promptly. 63 | 64 | The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR. Also the update will not work if your fork is located in an organization, not under your personal profile. 65 | Thanks 😄` 66 | }) 67 | } 68 | 69 | add-do-not-merge-label: 70 | if: > 71 | github.event.issue.pull_request && 72 | github.event.issue.state != 'closed' && 73 | github.actor != 'asyncapi-bot' && 74 | ( 75 | contains(github.event.comment.body, '/do-not-merge') || 76 | contains(github.event.comment.body, '/dnm' ) 77 | ) 78 | runs-on: ubuntu-latest 79 | steps: 80 | - name: Add do-not-merge label 81 | uses: actions/github-script@v6 82 | with: 83 | github-token: ${{ secrets.GH_TOKEN }} 84 | script: | 85 | github.rest.issues.addLabels({ 86 | issue_number: context.issue.number, 87 | owner: context.repo.owner, 88 | repo: context.repo.repo, 89 | labels: ['do-not-merge'] 90 | }) 91 | add-autoupdate-label: 92 | if: > 93 | github.event.issue.pull_request && 94 | github.event.issue.state != 'closed' && 95 | github.actor != 'asyncapi-bot' && 96 | ( 97 | contains(github.event.comment.body, '/autoupdate') || 98 | contains(github.event.comment.body, '/au' ) 99 | ) 100 | runs-on: ubuntu-latest 101 | steps: 102 | - name: Add autoupdate label 103 | uses: actions/github-script@v6 104 | with: 105 | github-token: ${{ secrets.GH_TOKEN }} 106 | script: | 107 | github.rest.issues.addLabels({ 108 | issue_number: context.issue.number, 109 | owner: context.repo.owner, 110 | repo: context.repo.repo, 111 | labels: ['autoupdate'] 112 | }) 113 | -------------------------------------------------------------------------------- /.github/workflows/automerge-for-humans-merging.yml: -------------------------------------------------------------------------------- 1 | # This workflow 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 workflow is to allow people to merge PR without a need of maintainer doing it. If all checks are in place (including maintainers approval) - JUST MERGE IT! 5 | name: Automerge For Humans 6 | 7 | on: 8 | pull_request_target: 9 | types: 10 | - labeled 11 | - unlabeled 12 | - synchronize 13 | - opened 14 | - edited 15 | - ready_for_review 16 | - reopened 17 | - unlocked 18 | 19 | jobs: 20 | automerge-for-humans: 21 | if: github.event.pull_request.draft == false && (github.event.pull_request.user.login != 'asyncapi-bot' || github.event.pull_request.user.login != 'dependabot[bot]' || github.event.pull_request.user.login != 'dependabot-preview[bot]') #it runs only if PR actor is not a bot, at least not a bot that we know 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Get list of authors 25 | uses: sergeysova/jq-action@v2 26 | id: authors 27 | with: 28 | # This cmd does following (line by line): 29 | # 1. CURL querying the list of commits of the current PR via GH API. Why? Because the current event payload does not carry info about the commits. 30 | # 2. Iterates over the previous returned payload, and creates an array with the filtered results (see below) so we can work wit it later. An example of payload can be found in https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#webhook-payload-example-34. 31 | # 3. Grabs the data we need for adding the `Co-authored-by: ...` lines later and puts it into objects to be used later on. 32 | # 4. Filters the results by excluding the current PR sender. We don't need to add it as co-author since is the PR creator and it will become by default the main author. 33 | # 5. Removes repeated authors (authors can have more than one commit in the PR). 34 | # 6. Builds the `Co-authored-by: ...` lines with actual info. 35 | # 7. Transforms the array into plain text. Thanks to this, the actual stdout of this step can be used by the next Workflow step (wich is basically the automerge). 36 | cmd: | 37 | curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" "${{github.event.pull_request._links.commits.href}}?per_page=100" | 38 | jq -r '[.[] 39 | | {name: .commit.author.name, email: .commit.author.email, login: .author.login}] 40 | | map(select(.login != "${{github.event.pull_request.user.login}}")) 41 | | unique 42 | | map("Co-authored-by: " + .name + " <" + .email + ">") 43 | | join("\n")' 44 | multiline: true 45 | - name: Automerge PR 46 | uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6 47 | env: 48 | GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" 49 | MERGE_LABELS: "!do-not-merge,ready-to-merge" 50 | MERGE_METHOD: "squash" 51 | # Using the output of the previous step (`Co-authored-by: ...` lines) as commit description. 52 | # Important to keep 2 empty lines as https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line mentions 53 | MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})\n\n\n${{ steps.authors.outputs.value }}" 54 | MERGE_RETRIES: "20" 55 | MERGE_RETRY_SLEEP: "30000" 56 | -------------------------------------------------------------------------------- /.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml: -------------------------------------------------------------------------------- 1 | # This workflow 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 | # Defence from evil contributor that after adding `ready-to-merge` all suddenly makes evil commit or evil change in PR title 5 | # Label is removed once above action is detected 6 | name: Remove ready-to-merge label 7 | 8 | on: 9 | pull_request_target: 10 | types: 11 | - synchronize 12 | - edited 13 | 14 | jobs: 15 | remove-ready-label: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Remove label 19 | uses: actions/github-script@v6 20 | with: 21 | github-token: ${{ secrets.GH_TOKEN }} 22 | script: | 23 | const labelToRemove = 'ready-to-merge'; 24 | const labels = context.payload.pull_request.labels; 25 | const isLabelPresent = labels.some(label => label.name === labelToRemove) 26 | if(!isLabelPresent) return; 27 | github.rest.issues.removeLabel({ 28 | issue_number: context.issue.number, 29 | owner: context.repo.owner, 30 | repo: context.repo.repo, 31 | name: labelToRemove 32 | }) 33 | -------------------------------------------------------------------------------- /.github/workflows/automerge-orphans.yml: -------------------------------------------------------------------------------- 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 | if: startsWith(github.repository, 'asyncapi/') 13 | name: Find orphans and notify 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@v3 18 | - name: Get list of orphans 19 | uses: actions/github-script@v6 20 | id: orphans 21 | with: 22 | github-token: ${{ secrets.GITHUB_TOKEN }} 23 | script: | 24 | const query = `query($owner:String!, $name:String!) { 25 | repository(owner:$owner, name:$name){ 26 | pullRequests(first: 100, states: OPEN){ 27 | nodes{ 28 | title 29 | url 30 | author { 31 | resourcePath 32 | } 33 | } 34 | } 35 | } 36 | }`; 37 | const variables = { 38 | owner: context.repo.owner, 39 | name: context.repo.repo 40 | }; 41 | const { repository: { pullRequests: { nodes } } } = await github.graphql(query, variables); 42 | 43 | let orphans = nodes.filter( (pr) => pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot') 44 | 45 | if (orphans.length) { 46 | core.setOutput('found', 'true'); 47 | //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 48 | //The thing is that handling multiple PRs will increase a complexity in this PR that in my opinion we should avoid 49 | //The other PRs will be reported the next day the action runs, or person that checks first url will notice the other ones 50 | core.setOutput('url', orphans[0].url); 51 | core.setOutput('title', orphans[0].title); 52 | } 53 | - if: steps.orphans.outputs.found == 'true' 54 | name: Convert markdown to slack markdown 55 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 56 | id: issuemarkdown 57 | with: 58 | markdown: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})" 59 | - if: steps.orphans.outputs.found == 'true' 60 | name: Send info about orphan to slack 61 | uses: rtCamp/action-slack-notify@v2 62 | env: 63 | SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}} 64 | SLACK_TITLE: 🚨 Not merged PR that should be automerged 🚨 65 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 66 | MSG_MINIMAL: true -------------------------------------------------------------------------------- /.github/workflows/automerge.yml: -------------------------------------------------------------------------------- 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 PRs from bots 5 | 6 | on: 7 | pull_request_target: 8 | types: 9 | - opened 10 | - synchronize 11 | 12 | jobs: 13 | autoapprove-for-bot: 14 | name: Autoapprove PR comming from a bot 15 | if: > 16 | contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]"]'), github.event.pull_request.user.login) && 17 | contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]"]'), github.actor) && 18 | !contains(github.event.pull_request.labels.*.name, 'released') 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: Autoapproving 22 | uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # v3.2.1 is used https://github.com/hmarr/auto-approve-action/releases/tag/v3.2.1 23 | with: 24 | github-token: "${{ secrets.GH_TOKEN_BOT_EVE }}" 25 | 26 | - name: Label autoapproved 27 | uses: actions/github-script@v6 28 | with: 29 | github-token: ${{ secrets.GH_TOKEN }} 30 | script: | 31 | github.rest.issues.addLabels({ 32 | issue_number: context.issue.number, 33 | owner: context.repo.owner, 34 | repo: context.repo.repo, 35 | labels: ['autoapproved', 'autoupdate'] 36 | }) 37 | 38 | automerge-for-bot: 39 | name: Automerge PR autoapproved by a bot 40 | needs: [autoapprove-for-bot] 41 | runs-on: ubuntu-latest 42 | steps: 43 | - name: Automerging 44 | uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6 45 | env: 46 | GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" 47 | GITHUB_LOGIN: asyncapi-bot 48 | MERGE_LABELS: "!do-not-merge" 49 | MERGE_METHOD: "squash" 50 | MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})" 51 | MERGE_RETRIES: "20" 52 | MERGE_RETRY_SLEEP: "30000" 53 | -------------------------------------------------------------------------------- /.github/workflows/autoupdate.yml: -------------------------------------------------------------------------------- 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 workflow is designed to work with: 5 | # - autoapprove and automerge workflows for dependabot and asyncapibot. 6 | # - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against 7 | 8 | # It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. 9 | # Autoupdating to latest destination branch works only in the context of upstream repo and not forks 10 | 11 | name: autoupdate 12 | 13 | on: 14 | push: 15 | branches-ignore: 16 | - 'version-bump/**' 17 | - 'dependabot/**' 18 | - 'bot/**' 19 | - 'all-contributors/**' 20 | 21 | jobs: 22 | autoupdate-for-bot: 23 | if: startsWith(github.repository, 'asyncapi/') 24 | name: Autoupdate autoapproved PR created in the upstream 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Autoupdating 28 | uses: docker://chinthakagodawita/autoupdate-action:v1 29 | env: 30 | GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}' 31 | PR_FILTER: "labelled" 32 | PR_LABELS: "autoupdate" 33 | PR_READY_STATE: "ready_for_review" 34 | MERGE_CONFLICT_ACTION: "ignore" 35 | -------------------------------------------------------------------------------- /.github/workflows/bounty-program-commands.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed at https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repository, as they will be overwritten with 3 | # changes made to the same file in the abovementioned repository. 4 | 5 | # The purpose of this workflow is to allow Bounty Team members 6 | # (https://github.com/orgs/asyncapi/teams/bounty_team) to issue commands to the 7 | # organization's global AsyncAPI bot related to the Bounty Program, while at the 8 | # same time preventing unauthorized users from misusing them. 9 | 10 | name: Bounty Program commands 11 | 12 | on: 13 | issue_comment: 14 | types: 15 | - created 16 | 17 | env: 18 | BOUNTY_PROGRAM_LABELS_JSON: | 19 | [ 20 | {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} 21 | ] 22 | 23 | jobs: 24 | guard-against-unauthorized-use: 25 | if: > 26 | github.actor != ('aeworxet' || 'thulieblack') && 27 | ( 28 | startsWith(github.event.comment.body, '/bounty' ) 29 | ) 30 | 31 | runs-on: ubuntu-latest 32 | 33 | steps: 34 | - name: ❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command 35 | uses: actions/github-script@v6 36 | 37 | with: 38 | github-token: ${{ secrets.GH_TOKEN }} 39 | script: | 40 | const commentText = `❌ @${{github.actor}} is not authorized to use the Bounty Program's commands. 41 | These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`; 42 | 43 | console.log(`❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command.`); 44 | github.rest.issues.createComment({ 45 | issue_number: context.issue.number, 46 | owner: context.repo.owner, 47 | repo: context.repo.repo, 48 | body: commentText 49 | }) 50 | 51 | add-label-bounty: 52 | if: > 53 | github.actor == ('aeworxet' || 'thulieblack') && 54 | ( 55 | startsWith(github.event.comment.body, '/bounty' ) 56 | ) 57 | 58 | runs-on: ubuntu-latest 59 | 60 | steps: 61 | - name: Add label `bounty` 62 | uses: actions/github-script@v6 63 | 64 | with: 65 | github-token: ${{ secrets.GH_TOKEN }} 66 | script: | 67 | const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); 68 | let LIST_OF_LABELS_FOR_REPO = await github.rest.issues.listLabelsForRepo({ 69 | owner: context.repo.owner, 70 | repo: context.repo.repo, 71 | }); 72 | 73 | LIST_OF_LABELS_FOR_REPO = LIST_OF_LABELS_FOR_REPO.data.map(key => key.name); 74 | 75 | if (!LIST_OF_LABELS_FOR_REPO.includes(BOUNTY_PROGRAM_LABELS[0].name)) { 76 | await github.rest.issues.createLabel({ 77 | owner: context.repo.owner, 78 | repo: context.repo.repo, 79 | name: BOUNTY_PROGRAM_LABELS[0].name, 80 | color: BOUNTY_PROGRAM_LABELS[0].color, 81 | description: BOUNTY_PROGRAM_LABELS[0].description 82 | }); 83 | } 84 | 85 | console.log('Adding label `bounty`...'); 86 | github.rest.issues.addLabels({ 87 | issue_number: context.issue.number, 88 | owner: context.repo.owner, 89 | repo: context.repo.repo, 90 | labels: [BOUNTY_PROGRAM_LABELS[0].name] 91 | }) 92 | 93 | remove-label-bounty: 94 | if: > 95 | github.actor == ('aeworxet' || 'thulieblack') && 96 | ( 97 | startsWith(github.event.comment.body, '/unbounty' ) 98 | ) 99 | 100 | runs-on: ubuntu-latest 101 | 102 | steps: 103 | - name: Remove label `bounty` 104 | uses: actions/github-script@v6 105 | 106 | with: 107 | github-token: ${{ secrets.GH_TOKEN }} 108 | script: | 109 | const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); 110 | let LIST_OF_LABELS_FOR_ISSUE = await github.rest.issues.listLabelsOnIssue({ 111 | owner: context.repo.owner, 112 | repo: context.repo.repo, 113 | issue_number: context.issue.number, 114 | }); 115 | 116 | LIST_OF_LABELS_FOR_ISSUE = LIST_OF_LABELS_FOR_ISSUE.data.map(key => key.name); 117 | 118 | if (LIST_OF_LABELS_FOR_ISSUE.includes(BOUNTY_PROGRAM_LABELS[0].name)) { 119 | console.log('Removing label `bounty`...'); 120 | github.rest.issues.removeLabel({ 121 | issue_number: context.issue.number, 122 | owner: context.repo.owner, 123 | repo: context.repo.repo, 124 | name: [BOUNTY_PROGRAM_LABELS[0].name] 125 | }) 126 | } 127 | -------------------------------------------------------------------------------- /.github/workflows/bump.yml: -------------------------------------------------------------------------------- 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-in-dependent-projects: 18 | name: Bump this package in repositories that depend on it 19 | if: startsWith(github.event.commits[0].message, 'chore(release):') 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Checkout repo 23 | uses: actions/checkout@v3 24 | - name: Check if Node.js project and has package.json 25 | id: packagejson 26 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 27 | - if: steps.packagejson.outputs.exists == 'true' 28 | name: Bumping latest version of this package in other repositories 29 | uses: derberg/npm-dependency-manager-for-your-github-org@1eafd3bf3974f21d395c1abac855cb04b295d570 # using v6.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6 30 | with: 31 | github_token: ${{ secrets.GH_TOKEN }} 32 | committer_username: asyncapi-bot 33 | committer_email: info@asyncapi.io 34 | repos_to_ignore: spec,bindings,saunter,server-api 35 | custom_id: "dependency update from asyncapi bot" 36 | -------------------------------------------------------------------------------- /.github/workflows/help-command.yml: -------------------------------------------------------------------------------- 1 | # This workflow 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: Create help comment 5 | 6 | on: 7 | issue_comment: 8 | types: 9 | - created 10 | 11 | jobs: 12 | create_help_comment_pr: 13 | if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }} 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Add comment to PR 17 | uses: actions/github-script@v6 18 | with: 19 | github-token: ${{ secrets.GH_TOKEN }} 20 | script: | 21 | //Yes to add comment to PR the same endpoint is use that we use to create a comment in issue 22 | //For more details http://developer.github.com/v3/issues/comments/ 23 | //Also proved by this action https://github.com/actions-ecosystem/action-create-comment/blob/main/src/main.ts 24 | github.rest.issues.createComment({ 25 | issue_number: context.issue.number, 26 | owner: context.repo.owner, 27 | repo: context.repo.repo, 28 | body: `Hello, @${{ github.actor }}! 👋🏼 29 | 30 | I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand! 31 | 32 | At the moment the following comments are supported in pull requests: 33 | 34 | - \`/please-take-a-look\` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. 35 | - \`/ready-to-merge\` or \`/rtm\` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added 36 | - \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added 37 | - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. (Currently only works for upstream branches.) 38 | - \`/update\` or \`/u\` - This comment will update the PR with the latest changes from the target branch. Unless there is a merge conflict or it is a draft PR. NOTE: this only updates the PR once, so if you need to update again, you need to call the command again.` 39 | }) 40 | 41 | create_help_comment_issue: 42 | if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }} 43 | runs-on: ubuntu-latest 44 | steps: 45 | - name: Add comment to Issue 46 | uses: actions/github-script@v6 47 | with: 48 | github-token: ${{ secrets.GH_TOKEN }} 49 | script: | 50 | github.rest.issues.createComment({ 51 | issue_number: context.issue.number, 52 | owner: context.repo.owner, 53 | repo: context.repo.repo, 54 | body: `Hello, @${{ github.actor }}! 👋🏼 55 | 56 | I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand! 57 | 58 | At the moment the following comments are supported in issues: 59 | 60 | - \`/good-first-issue {js | ts | java | go | docs | design | ci-cd}\` or \`/gfi {js | ts | java | go | docs | design | ci-cd}\` - label an issue as a \`good first issue\`. 61 | example: \`/gfi js\` or \`/good-first-issue ci-cd\`` 62 | }) -------------------------------------------------------------------------------- /.github/workflows/if-docker-pr-testing.yml: -------------------------------------------------------------------------------- 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 a Dockerfile in the root of the project 4 | name: PR testing - if Docker 5 | 6 | on: 7 | pull_request: 8 | types: [opened, reopened, synchronize, ready_for_review] 9 | 10 | env: 11 | IMAGE_NAME: ${{ github.repository }} 12 | 13 | jobs: 14 | test-docker-pr: 15 | name: Test Docker build 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - if: > 20 | !github.event.pull_request.draft && !( 21 | (github.actor == 'asyncapi-bot' && ( 22 | startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || 23 | startsWith(github.event.pull_request.title, 'chore(release):') 24 | )) || 25 | (github.actor == 'asyncapi-bot-eve' && ( 26 | startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || 27 | startsWith(github.event.pull_request.title, 'chore(release):') 28 | )) || 29 | (github.actor == 'allcontributors[bot]' && 30 | startsWith(github.event.pull_request.title, 'docs: add') 31 | ) 32 | ) 33 | id: should_run 34 | name: Should Run 35 | run: echo "shouldrun=true" >> $GITHUB_OUTPUT 36 | 37 | - if: steps.should_run.outputs.shouldrun == 'true' 38 | name: Checkout repository 39 | uses: actions/checkout@v3 40 | 41 | - if: steps.should_run.outputs.shouldrun == 'true' 42 | name: Check if project has a Dockerfile 43 | id: docker 44 | run: test -e ./Dockerfile && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 45 | shell: bash 46 | 47 | - if: steps.docker.outputs.exists == 'true' 48 | name: Set up Docker Buildx 49 | uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # use 2.5.0 https://github.com/docker/setup-buildx-action/releases/tag/v2.5.0 50 | 51 | - if: steps.docker.outputs.exists == 'true' 52 | name: Extract metadata for Docker 53 | id: meta 54 | uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # use 4.3.0 https://github.com/docker/metadata-action/releases/tag/v4.3.0 55 | with: 56 | images: ${{ env.IMAGE_NAME }} 57 | 58 | - if: steps.docker.outputs.exists == 'true' 59 | name: Build Docker image 60 | uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # use 4.0.0 https://github.com/docker/build-push-action/releases/tag/v4.0.0 61 | with: 62 | context: . 63 | push: false 64 | tags: ${{ steps.meta.outputs.tags }} 65 | labels: ${{ steps.meta.outputs.labels }} 66 | cache-from: type=gha 67 | cache-to: type=gha,mode=max 68 | -------------------------------------------------------------------------------- /.github/workflows/if-nodejs-pr-testing.yml: -------------------------------------------------------------------------------- 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 | # It does magic only if there is package.json file in the root of the project 5 | name: PR testing - if Node project 6 | 7 | on: 8 | pull_request: 9 | types: [opened, reopened, synchronize, ready_for_review] 10 | 11 | jobs: 12 | test-nodejs-pr: 13 | name: Test NodeJS PR - ${{ matrix.os }} 14 | runs-on: ${{ matrix.os }} 15 | strategy: 16 | matrix: 17 | os: [ubuntu-latest, macos-latest, windows-latest] 18 | steps: 19 | - if: > 20 | !github.event.pull_request.draft && !( 21 | (github.actor == 'asyncapi-bot' && ( 22 | startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || 23 | startsWith(github.event.pull_request.title, 'chore(release):') 24 | )) || 25 | (github.actor == 'asyncapi-bot-eve' && ( 26 | startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || 27 | startsWith(github.event.pull_request.title, 'chore(release):') 28 | )) || 29 | (github.actor == 'allcontributors[bot]' && 30 | startsWith(github.event.pull_request.title, 'docs: add') 31 | ) 32 | ) 33 | id: should_run 34 | name: Should Run 35 | run: echo "shouldrun=true" >> $GITHUB_OUTPUT 36 | - if: steps.should_run.outputs.shouldrun == 'true' 37 | name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows 38 | run: | 39 | git config --global core.autocrlf false 40 | git config --global core.eol lf 41 | - if: steps.should_run.outputs.shouldrun == 'true' 42 | name: Checkout repository 43 | uses: actions/checkout@v3 44 | - if: steps.should_run.outputs.shouldrun == 'true' 45 | name: Check if Node.js project and has package.json 46 | id: packagejson 47 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 48 | shell: bash 49 | - if: steps.packagejson.outputs.exists == 'true' 50 | name: Check package-lock version 51 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master 52 | id: lockversion 53 | - if: steps.packagejson.outputs.exists == 'true' 54 | name: Setup Node.js 55 | uses: actions/setup-node@v3 56 | with: 57 | node-version: "${{ steps.lockversion.outputs.version }}" 58 | cache: 'npm' 59 | cache-dependency-path: '**/package-lock.json' 60 | - if: steps.packagejson.outputs.exists == 'true' 61 | name: Install dependencies 62 | id: first-installation 63 | run: npm install --loglevel verbose 64 | continue-on-error: true 65 | - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' 66 | name: Clear NPM cache and install deps again 67 | run: | 68 | npm cache clean --force 69 | npm install --loglevel verbose 70 | - if: steps.packagejson.outputs.exists == 'true' 71 | name: Test 72 | run: npm test --if-present 73 | - if: steps.packagejson.outputs.exists == 'true' 74 | name: Run linter 75 | run: npm run lint --if-present 76 | - if: steps.packagejson.outputs.exists == 'true' 77 | name: Run release assets generation to make sure PR does not break it 78 | run: npm run generate:assets --if-present 79 | -------------------------------------------------------------------------------- /.github/workflows/if-nodejs-release.yml: -------------------------------------------------------------------------------- 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 | # It does magic only if there is package.json file in the root of the project 5 | name: Release - if Node project 6 | 7 | on: 8 | push: 9 | branches: 10 | - master 11 | # below lines are not enough to have release supported for these branches 12 | # make sure configuration of `semantic-release` package mentions these branches 13 | - next-spec 14 | - next-major 15 | - next-major-spec 16 | - beta 17 | - alpha 18 | - next 19 | 20 | jobs: 21 | 22 | test-nodejs: 23 | # We just check the message of first commit as there is always just one commit because we squash into one before merging 24 | # "commits" contains array of objects where one of the properties is commit "message" 25 | # Release workflow will be skipped if release conventional commits are not used 26 | if: | 27 | startsWith( github.repository, 'asyncapi/' ) && 28 | (startsWith( github.event.commits[0].message , 'fix:' ) || 29 | startsWith( github.event.commits[0].message, 'fix!:' ) || 30 | startsWith( github.event.commits[0].message, 'feat:' ) || 31 | startsWith( github.event.commits[0].message, 'feat!:' )) 32 | name: Test NodeJS release on ${{ matrix.os }} 33 | runs-on: ${{ matrix.os }} 34 | strategy: 35 | matrix: 36 | # Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. 37 | # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 38 | os: [ubuntu-latest, macos-13, windows-latest] 39 | steps: 40 | - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows 41 | run: | 42 | git config --global core.autocrlf false 43 | git config --global core.eol lf 44 | shell: bash 45 | - name: Checkout repository 46 | uses: actions/checkout@v4 47 | - name: Check if Node.js project and has package.json 48 | id: packagejson 49 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 50 | shell: bash 51 | - if: steps.packagejson.outputs.exists == 'true' 52 | name: Check package-lock version 53 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master 54 | id: lockversion 55 | - if: steps.packagejson.outputs.exists == 'true' 56 | name: Setup Node.js 57 | uses: actions/setup-node@v4 58 | with: 59 | node-version: "${{ steps.lockversion.outputs.version }}" 60 | - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' 61 | name: Install npm cli 8 62 | shell: bash 63 | #npm cli 10 is buggy because of some cache issues 64 | run: npm install -g npm@8.19.4 65 | - if: steps.packagejson.outputs.exists == 'true' 66 | name: Install dependencies 67 | shell: bash 68 | run: npm ci 69 | - if: steps.packagejson.outputs.exists == 'true' 70 | name: Run test 71 | run: npm test --if-present 72 | - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel 73 | name: Report workflow run status to Slack 74 | uses: 8398a7/action-slack@v3 75 | with: 76 | status: ${{ job.status }} 77 | fields: repo,action,workflow 78 | text: 'Release workflow failed in testing job' 79 | env: 80 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} 81 | 82 | release: 83 | needs: [test-nodejs] 84 | name: Publish to any of NPM, Github, or Docker Hub 85 | runs-on: ubuntu-latest 86 | steps: 87 | - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows 88 | run: | 89 | git config --global core.autocrlf false 90 | git config --global core.eol lf 91 | - name: Checkout repository 92 | uses: actions/checkout@v4 93 | - name: Check if Node.js project and has package.json 94 | id: packagejson 95 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 96 | shell: bash 97 | - if: steps.packagejson.outputs.exists == 'true' 98 | name: Check package-lock version 99 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master 100 | id: lockversion 101 | - if: steps.packagejson.outputs.exists == 'true' 102 | name: Setup Node.js 103 | uses: actions/setup-node@v4 104 | with: 105 | node-version: "${{ steps.lockversion.outputs.version }}" 106 | - if: steps.packagejson.outputs.exists == 'true' 107 | name: Install dependencies 108 | shell: bash 109 | run: npm ci 110 | - if: steps.packagejson.outputs.exists == 'true' 111 | name: Add plugin for conventional commits for semantic-release 112 | run: npm install --save-dev conventional-changelog-conventionalcommits@5.0.0 113 | - if: steps.packagejson.outputs.exists == 'true' 114 | name: Publish to any of NPM, Github, and Docker Hub 115 | id: release 116 | env: 117 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} 118 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 119 | DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} 120 | DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 121 | GIT_AUTHOR_NAME: asyncapi-bot 122 | GIT_AUTHOR_EMAIL: info@asyncapi.io 123 | GIT_COMMITTER_NAME: asyncapi-bot 124 | GIT_COMMITTER_EMAIL: info@asyncapi.io 125 | run: npx semantic-release@19.0.4 126 | - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel 127 | name: Report workflow run status to Slack 128 | uses: 8398a7/action-slack@v3 129 | with: 130 | status: ${{ job.status }} 131 | fields: repo,action,workflow 132 | text: 'Release workflow failed in release job' 133 | env: 134 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} 135 | -------------------------------------------------------------------------------- /.github/workflows/if-nodejs-version-bump.yml: -------------------------------------------------------------------------------- 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 | # It does magic only if there is package.json file in the root of the project 5 | name: Version bump - if Node.js project 6 | 7 | on: 8 | release: 9 | types: 10 | - published 11 | 12 | jobs: 13 | version_bump: 14 | name: Generate assets and bump NodeJS 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v3 19 | with: 20 | # target branch of release. More info https://docs.github.com/en/rest/reference/repos#releases 21 | # in case release is created from release branch then we need to checkout from given branch 22 | # if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working 23 | ref: ${{ github.event.release.target_commitish }} 24 | - name: Check if Node.js project and has package.json 25 | id: packagejson 26 | run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT 27 | - if: steps.packagejson.outputs.exists == 'true' 28 | name: Check package-lock version 29 | uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master 30 | id: lockversion 31 | - if: steps.packagejson.outputs.exists == 'true' 32 | name: Setup Node.js 33 | uses: actions/setup-node@v3 34 | with: 35 | node-version: "${{ steps.lockversion.outputs.version }}" 36 | cache: 'npm' 37 | cache-dependency-path: '**/package-lock.json' 38 | - if: steps.packagejson.outputs.exists == 'true' 39 | name: Install dependencies 40 | run: npm ci 41 | - if: steps.packagejson.outputs.exists == 'true' 42 | name: Assets generation 43 | run: npm run generate:assets --if-present 44 | - if: steps.packagejson.outputs.exists == 'true' 45 | name: Bump version in package.json 46 | # There is no need to substract "v" from the tag as version script handles it 47 | # 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 48 | # 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 49 | run: VERSION=${{github.event.release.tag_name}} npm run bump:version 50 | - if: steps.packagejson.outputs.exists == 'true' 51 | name: Create Pull Request with updated asset files including package.json 52 | uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # use 4.2.4 https://github.com/peter-evans/create-pull-request/releases/tag/v4.2.4 53 | with: 54 | token: ${{ secrets.GH_TOKEN }} 55 | commit-message: 'chore(release): ${{github.event.release.tag_name}}' 56 | committer: asyncapi-bot 57 | author: asyncapi-bot 58 | title: 'chore(release): ${{github.event.release.tag_name}}' 59 | body: 'Version bump in package.json for release [${{github.event.release.tag_name}}](${{github.event.release.html_url}})' 60 | branch: version-bump/${{github.event.release.tag_name}} 61 | - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel 62 | name: Report workflow run status to Slack 63 | uses: 8398a7/action-slack@v3 64 | with: 65 | status: ${{ job.status }} 66 | fields: repo,action,workflow 67 | text: 'Unable to bump the version in package.json after the release' 68 | env: 69 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} -------------------------------------------------------------------------------- /.github/workflows/issues-prs-notifications.yml: -------------------------------------------------------------------------------- 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 | issues: 9 | types: [opened, reopened] 10 | 11 | pull_request_target: 12 | types: [opened, reopened, ready_for_review] 13 | 14 | discussion: 15 | types: [created] 16 | 17 | jobs: 18 | issue: 19 | if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' 20 | name: Notify slack on every new issue 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Convert markdown to slack markdown for issue 24 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 25 | id: issuemarkdown 26 | with: 27 | markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" 28 | - name: Send info about issue 29 | uses: rtCamp/action-slack-notify@v2 30 | env: 31 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 32 | SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛 33 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 34 | MSG_MINIMAL: true 35 | 36 | pull_request: 37 | if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' 38 | name: Notify slack on every new pull request 39 | runs-on: ubuntu-latest 40 | steps: 41 | - name: Convert markdown to slack markdown for pull request 42 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 43 | id: prmarkdown 44 | with: 45 | markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" 46 | - name: Send info about pull request 47 | uses: rtCamp/action-slack-notify@v2 48 | env: 49 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 50 | SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪 51 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 52 | MSG_MINIMAL: true 53 | 54 | discussion: 55 | if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' 56 | name: Notify slack on every new pull request 57 | runs-on: ubuntu-latest 58 | steps: 59 | - name: Convert markdown to slack markdown for pull request 60 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 61 | id: discussionmarkdown 62 | with: 63 | markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" 64 | - name: Send info about pull request 65 | uses: rtCamp/action-slack-notify@v2 66 | env: 67 | SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}} 68 | SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬 69 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 70 | MSG_MINIMAL: true 71 | -------------------------------------------------------------------------------- /.github/workflows/lint-pr-title.yml: -------------------------------------------------------------------------------- 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 | pull_request_target: 8 | types: [opened, reopened, synchronize, edited, ready_for_review] 9 | 10 | jobs: 11 | lint-pr-title: 12 | name: Lint PR title 13 | runs-on: ubuntu-latest 14 | steps: 15 | # Since this workflow is REQUIRED for a PR to be mergable, we have to have this 'if' statement in step level instead of job level. 16 | - if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }} 17 | uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 #version 5.2.0 https://github.com/amannn/action-semantic-pull-request/releases/tag/v5.2.0 18 | id: lint_pr_title 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} 21 | with: 22 | subjectPattern: ^(?![A-Z]).+$ 23 | subjectPatternError: | 24 | The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character. 25 | 26 | # Comments the error message from the above lint_pr_title action 27 | - if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor)}} 28 | name: Comment on PR 29 | uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0 30 | with: 31 | header: pr-title-lint-error 32 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} 33 | message: | 34 | 35 | We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). 36 | More details 👇🏼 37 | ``` 38 | ${{ steps.lint_pr_title.outputs.error_message}} 39 | ``` 40 | # deletes the error comment if the title is correct 41 | - if: ${{ steps.lint_pr_title.outputs.error_message == null }} 42 | name: delete the comment 43 | uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0 44 | with: 45 | header: pr-title-lint-error 46 | delete: true 47 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} 48 | -------------------------------------------------------------------------------- /.github/workflows/notify-tsc-members-mention.yml: -------------------------------------------------------------------------------- 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 and email subscribers whenever TSC members are mentioned in GitHub 6 | 7 | on: 8 | issue_comment: 9 | types: 10 | - created 11 | 12 | discussion_comment: 13 | types: 14 | - created 15 | 16 | issues: 17 | types: 18 | - opened 19 | 20 | pull_request_target: 21 | types: 22 | - opened 23 | 24 | discussion: 25 | types: 26 | - created 27 | 28 | jobs: 29 | issue: 30 | if: github.event_name == 'issues' && contains(github.event.issue.body, '@asyncapi/tsc_members') 31 | name: TSC notification on every new issue 32 | runs-on: ubuntu-latest 33 | steps: 34 | - name: Checkout repository 35 | uses: actions/checkout@v3 36 | - name: Setup Node.js 37 | uses: actions/setup-node@v3 38 | with: 39 | node-version: 16 40 | cache: 'npm' 41 | cache-dependency-path: '**/package-lock.json' 42 | ######### 43 | # Handling Slack notifications 44 | ######### 45 | - name: Convert markdown to slack markdown 46 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 47 | id: issuemarkdown 48 | with: 49 | markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" 50 | - name: Send info about issue 51 | uses: rtCamp/action-slack-notify@v2 52 | env: 53 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 54 | SLACK_TITLE: 🆘 New issue that requires TSC Members attention 🆘 55 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 56 | MSG_MINIMAL: true 57 | ######### 58 | # Handling Mailchimp notifications 59 | ######### 60 | - name: Install deps 61 | run: npm install 62 | working-directory: ./.github/workflows/scripts/mailchimp 63 | - name: Send email with MailChimp 64 | uses: actions/github-script@v6 65 | env: 66 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 67 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 68 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 69 | with: 70 | script: | 71 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 72 | sendEmail('${{github.event.issue.html_url}}', '${{github.event.issue.title}}'); 73 | 74 | pull_request: 75 | if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members') 76 | name: TSC notification on every new pull request 77 | runs-on: ubuntu-latest 78 | steps: 79 | - name: Checkout repository 80 | uses: actions/checkout@v3 81 | - name: Setup Node.js 82 | uses: actions/setup-node@v3 83 | with: 84 | node-version: 16 85 | cache: 'npm' 86 | cache-dependency-path: '**/package-lock.json' 87 | ######### 88 | # Handling Slack notifications 89 | ######### 90 | - name: Convert markdown to slack markdown 91 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 92 | id: prmarkdown 93 | with: 94 | markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" 95 | - name: Send info about pull request 96 | uses: rtCamp/action-slack-notify@v2 97 | env: 98 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 99 | SLACK_TITLE: 🆘 New PR that requires TSC Members attention 🆘 100 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 101 | MSG_MINIMAL: true 102 | ######### 103 | # Handling Mailchimp notifications 104 | ######### 105 | - name: Install deps 106 | run: npm install 107 | working-directory: ./.github/workflows/scripts/mailchimp 108 | - name: Send email with MailChimp 109 | uses: actions/github-script@v6 110 | env: 111 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 112 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 113 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 114 | with: 115 | script: | 116 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 117 | sendEmail('${{github.event.pull_request.html_url}}', '${{github.event.pull_request.title}}'); 118 | 119 | discussion: 120 | if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members') 121 | name: TSC notification on every new discussion 122 | runs-on: ubuntu-latest 123 | steps: 124 | - name: Checkout repository 125 | uses: actions/checkout@v3 126 | - name: Setup Node.js 127 | uses: actions/setup-node@v3 128 | with: 129 | node-version: 16 130 | cache: 'npm' 131 | cache-dependency-path: '**/package-lock.json' 132 | ######### 133 | # Handling Slack notifications 134 | ######### 135 | - name: Convert markdown to slack markdown 136 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 137 | id: discussionmarkdown 138 | with: 139 | markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" 140 | - name: Send info about pull request 141 | uses: rtCamp/action-slack-notify@v2 142 | env: 143 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 144 | SLACK_TITLE: 🆘 New discussion that requires TSC Members attention 🆘 145 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 146 | MSG_MINIMAL: true 147 | ######### 148 | # Handling Mailchimp notifications 149 | ######### 150 | - name: Install deps 151 | run: npm install 152 | working-directory: ./.github/workflows/scripts/mailchimp 153 | - name: Send email with MailChimp 154 | uses: actions/github-script@v6 155 | env: 156 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 157 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 158 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 159 | with: 160 | script: | 161 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 162 | sendEmail('${{github.event.discussion.html_url}}', '${{github.event.discussion.title}}'); 163 | 164 | issue_comment: 165 | if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }} 166 | name: TSC notification on every new comment in issue 167 | runs-on: ubuntu-latest 168 | steps: 169 | - name: Checkout repository 170 | uses: actions/checkout@v3 171 | - name: Setup Node.js 172 | uses: actions/setup-node@v3 173 | with: 174 | node-version: 16 175 | cache: 'npm' 176 | cache-dependency-path: '**/package-lock.json' 177 | ######### 178 | # Handling Slack notifications 179 | ######### 180 | - name: Convert markdown to slack markdown 181 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 182 | id: issuemarkdown 183 | with: 184 | markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 185 | - name: Send info about issue comment 186 | uses: rtCamp/action-slack-notify@v2 187 | env: 188 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 189 | SLACK_TITLE: 🆘 New comment under existing issue that requires TSC Members attention 🆘 190 | SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}} 191 | MSG_MINIMAL: true 192 | ######### 193 | # Handling Mailchimp notifications 194 | ######### 195 | - name: Install deps 196 | run: npm install 197 | working-directory: ./.github/workflows/scripts/mailchimp 198 | - name: Send email with MailChimp 199 | uses: actions/github-script@v6 200 | env: 201 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 202 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 203 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 204 | with: 205 | script: | 206 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 207 | sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}'); 208 | 209 | pr_comment: 210 | if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') 211 | name: TSC notification on every new comment in pr 212 | runs-on: ubuntu-latest 213 | steps: 214 | - name: Checkout repository 215 | uses: actions/checkout@v3 216 | - name: Setup Node.js 217 | uses: actions/setup-node@v3 218 | with: 219 | node-version: 16 220 | cache: 'npm' 221 | cache-dependency-path: '**/package-lock.json' 222 | ######### 223 | # Handling Slack notifications 224 | ######### 225 | - name: Convert markdown to slack markdown 226 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 227 | id: prmarkdown 228 | with: 229 | markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 230 | - name: Send info about PR comment 231 | uses: rtCamp/action-slack-notify@v2 232 | env: 233 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 234 | SLACK_TITLE: 🆘 New comment under existing PR that requires TSC Members attention 🆘 235 | SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}} 236 | MSG_MINIMAL: true 237 | ######### 238 | # Handling Mailchimp notifications 239 | ######### 240 | - name: Install deps 241 | run: npm install 242 | working-directory: ./.github/workflows/scripts/mailchimp 243 | - name: Send email with MailChimp 244 | uses: actions/github-script@v6 245 | env: 246 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 247 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 248 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 249 | with: 250 | script: | 251 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 252 | sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}'); 253 | 254 | discussion_comment: 255 | if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members') 256 | name: TSC notification on every new comment in discussion 257 | runs-on: ubuntu-latest 258 | steps: 259 | - name: Checkout repository 260 | uses: actions/checkout@v3 261 | - name: Setup Node.js 262 | uses: actions/setup-node@v3 263 | with: 264 | node-version: 16 265 | cache: 'npm' 266 | cache-dependency-path: '**/package-lock.json' 267 | ######### 268 | # Handling Slack notifications 269 | ######### 270 | - name: Convert markdown to slack markdown 271 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 272 | id: discussionmarkdown 273 | with: 274 | markdown: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" 275 | - name: Send info about discussion comment 276 | uses: rtCamp/action-slack-notify@v2 277 | env: 278 | SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}} 279 | SLACK_TITLE: 🆘 New comment under existing discussion that requires TSC Members attention 🆘 280 | SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}} 281 | MSG_MINIMAL: true 282 | ######### 283 | # Handling Mailchimp notifications 284 | ######### 285 | - name: Install deps 286 | run: npm install 287 | working-directory: ./.github/workflows/scripts/mailchimp 288 | - name: Send email with MailChimp 289 | uses: actions/github-script@v6 290 | env: 291 | CALENDAR_ID: ${{ secrets.CALENDAR_ID }} 292 | CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} 293 | MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }} 294 | with: 295 | script: | 296 | const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js'); 297 | sendEmail('${{github.event.comment.html_url}}', '${{github.event.discussion.title}}'); 298 | -------------------------------------------------------------------------------- /.github/workflows/please-take-a-look-command.yml: -------------------------------------------------------------------------------- 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 | # It uses Github actions to listen for comments on issues and pull requests and 5 | # if the comment contains /please-take-a-look or /ptal it will add a comment pinging 6 | # the code-owners who are reviewers for PR 7 | 8 | name: Please take a Look 9 | 10 | on: 11 | issue_comment: 12 | types: [created] 13 | 14 | jobs: 15 | ping-for-attention: 16 | if: > 17 | github.event.issue.pull_request && 18 | github.event.issue.state != 'closed' && 19 | github.actor != 'asyncapi-bot' && 20 | ( 21 | contains(github.event.comment.body, '/please-take-a-look') || 22 | contains(github.event.comment.body, '/ptal') || 23 | contains(github.event.comment.body, '/PTAL') 24 | ) 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Check for Please Take a Look Command 28 | uses: actions/github-script@v6 29 | with: 30 | github-token: ${{ secrets.GH_TOKEN }} 31 | script: | 32 | const prDetailsUrl = context.payload.issue.pull_request.url; 33 | const { data: pull } = await github.request(prDetailsUrl); 34 | const reviewers = pull.requested_reviewers.map(reviewer => reviewer.login); 35 | 36 | const { data: reviews } = await github.rest.pulls.listReviews({ 37 | owner: context.repo.owner, 38 | repo: context.repo.repo, 39 | pull_number: context.issue.number 40 | }); 41 | 42 | const reviewersWhoHaveReviewed = reviews.map(review => review.user.login); 43 | 44 | const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer)); 45 | 46 | if (reviewersWhoHaveNotReviewed.length > 0) { 47 | const comment = reviewersWhoHaveNotReviewed.filter(reviewer => reviewer !== 'asyncapi-bot-eve' ).map(reviewer => `@${reviewer}`).join(' '); 48 | await github.rest.issues.createComment({ 49 | issue_number: context.issue.number, 50 | owner: context.repo.owner, 51 | repo: context.repo.repo, 52 | body: `${comment} Please take a look at this PR. Thanks! :wave:` 53 | }); 54 | } 55 | -------------------------------------------------------------------------------- /.github/workflows/release-announcements.yml: -------------------------------------------------------------------------------- 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: 'Announce releases in different channels' 5 | 6 | on: 7 | release: 8 | types: 9 | - published 10 | 11 | jobs: 12 | 13 | slack-announce: 14 | name: Slack - notify on every release 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v3 19 | - name: Convert markdown to slack markdown for issue 20 | uses: asyncapi/.github/.github/actions/slackify-markdown@master 21 | id: markdown 22 | with: 23 | markdown: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}" 24 | - name: Send info about release to Slack 25 | uses: rtCamp/action-slack-notify@v2 26 | env: 27 | SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES }} 28 | SLACK_TITLE: Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱💪🍾🎂 29 | SLACK_MESSAGE: ${{steps.markdown.outputs.text}} 30 | MSG_MINIMAL: true 31 | 32 | twitter-announce: 33 | name: Twitter - notify on minor and major releases 34 | runs-on: ubuntu-latest 35 | steps: 36 | - name: Checkout repo 37 | uses: actions/checkout@v3 38 | - name: Get version of last and previous release 39 | uses: actions/github-script@v6 40 | id: versions 41 | with: 42 | github-token: ${{ secrets.GITHUB_TOKEN }} 43 | script: | 44 | const query = `query($owner:String!, $name:String!) { 45 | repository(owner:$owner, name:$name){ 46 | releases(first: 2, orderBy: {field: CREATED_AT, direction: DESC}) { 47 | nodes { 48 | name 49 | } 50 | } 51 | } 52 | }`; 53 | const variables = { 54 | owner: context.repo.owner, 55 | name: context.repo.repo 56 | }; 57 | const { repository: { releases: { nodes } } } = await github.graphql(query, variables); 58 | core.setOutput('lastver', nodes[0].name); 59 | // 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 60 | // We should tweet about the release no matter of the type as it is initial release 61 | if (nodes.length != 1) core.setOutput('previousver', nodes[1].name); 62 | - name: Identify release type 63 | id: releasetype 64 | # if previousver is not provided then this steps just logs information about missing version, no errors 65 | run: echo "type=$(npx -q -p semver-diff-cli semver-diff ${{steps.versions.outputs.previousver}} ${{steps.versions.outputs.lastver}})" >> $GITHUB_OUTPUT 66 | - name: Get name of the person that is behind the newly released version 67 | id: author 68 | run: echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT 69 | - name: Publish information about the release to Twitter # tweet only if detected version change is not a patch 70 | # tweet goes out even if the type is not major or minor but "You need provide version number to compare." 71 | # 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 72 | if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same 73 | uses: m1ner79/Github-Twittction@d1e508b6c2170145127138f93c49b7c46c6ff3a7 # using 2.0.0 https://github.com/m1ner79/Github-Twittction/releases/tag/v2.0.0 74 | with: 75 | 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}}" 76 | twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }} 77 | twitter_consumer_secret: ${{ secrets.TWITTER_CONSUMER_SECRET }} 78 | twitter_access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} 79 | twitter_access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} -------------------------------------------------------------------------------- /.github/workflows/release-docker.yml: -------------------------------------------------------------------------------- 1 | name: Release Docker Image 2 | on: 3 | release: 4 | types: 5 | - published 6 | 7 | jobs: 8 | 9 | release: 10 | name: Docker build and push 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v3 15 | with: 16 | ref: master 17 | - name: Get version without v character 18 | id: version 19 | run: | 20 | VERSION=${{github.event.release.tag_name}} 21 | VERSION_WITHOUT_V=${VERSION:1} 22 | echo "value=${VERSION_WITHOUT_V}" >> $GITHUB_OUTPUT 23 | - name: Release to Docker 24 | run: | 25 | echo ${{secrets.DOCKER_PASSWORD}} | docker login -u ${{secrets.DOCKER_USERNAME}} --password-stdin 26 | npm run docker:build 27 | docker tag asyncapi/github-action-for-cli:latest asyncapi/github-action-for-cli:${{ steps.version.outputs.value }} 28 | docker push asyncapi/github-action-for-cli:${{ steps.version.outputs.value }} 29 | docker push asyncapi/github-action-for-cli:latest -------------------------------------------------------------------------------- /.github/workflows/scripts/README.md: -------------------------------------------------------------------------------- 1 | The entire `scripts` directory is centrally managed in [.github](https://github.com/asyncapi/.github/) repository. Any changes in this folder should be done in central repository. -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/htmlContent.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is centrally managed in https://github.com/asyncapi/.github/ 3 | * 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 4 | */ 5 | module.exports = (link, title) => { 6 | 7 | return ` 8 | 9 | 10 | 11 | 19 | 20 | 21 | 22 | *|MC:SUBJECT|* 23 | 24 | 350 | 351 | 352 | 353 | 354 |
355 | 356 | 357 | 489 | 490 |
358 | 359 | 364 | 365 | 366 | 405 | 406 | 407 | 443 | 444 | 445 | 480 | 481 |
367 | 368 | 369 | 402 | 403 | 404 |
370 | 374 | 375 | 378 | 379 | 380 | 381 | 391 | 392 |
382 | 383 | Hey *|FNAME|*,
384 |
385 | There is a new topic at AsyncAPI Initiative that requires Technical Steering Committee attention. 386 |
387 | Please have a look if it is just something you need to be aware of, or maybe your vote is needed. 388 |
389 | Topic: ${ title }. 390 |
393 | 396 | 397 | 401 |
408 | 409 | 410 | 411 | 412 | 440 | 441 | 442 |
413 | 417 | 418 | 421 | 422 | 423 | 424 | 429 | 430 |
425 | 426 | Cheers,
427 | AsyncAPI Initiative 428 |
431 | 434 | 435 | 439 |
446 | 447 | 448 | 477 | 478 | 479 |
449 | 453 | 454 | 457 | 458 | 459 | 460 | 466 | 467 |
461 | 462 | Want to change how you receive these emails?
463 | You can update your preferences or unsubscribe from this list.
464 |   465 |
468 | 471 | 472 | 476 |
482 | 487 | 488 |
491 |
492 | 493 | 494 | ` 495 | } -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This code is centrally managed in https://github.com/asyncapi/.github/ 3 | * 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 4 | */ 5 | const mailchimp = require('@mailchimp/mailchimp_marketing'); 6 | const core = require('@actions/core'); 7 | const htmlContent = require('./htmlContent.js'); 8 | 9 | /** 10 | * Sending API request to mailchimp to schedule email to subscribers 11 | * Input is the URL to issue/discussion or other resource 12 | */ 13 | module.exports = async (link, title) => { 14 | 15 | let newCampaign; 16 | 17 | mailchimp.setConfig({ 18 | apiKey: process.env.MAILCHIMP_API_KEY, 19 | server: 'us12' 20 | }); 21 | 22 | /* 23 | * First we create campaign 24 | */ 25 | try { 26 | newCampaign = await mailchimp.campaigns.create({ 27 | type: 'regular', 28 | recipients: { 29 | list_id: '6e3e437abe', 30 | segment_opts: { 31 | match: 'any', 32 | conditions: [{ 33 | condition_type: 'Interests', 34 | field: 'interests-2801e38b9f', 35 | op: 'interestcontains', 36 | value: ['f7204f9b90'] 37 | }] 38 | } 39 | }, 40 | settings: { 41 | subject_line: `TSC attention required: ${ title }`, 42 | preview_text: 'Check out the latest topic that TSC members have to be aware of', 43 | title: `New topic info - ${ new Date(Date.now()).toUTCString()}`, 44 | from_name: 'AsyncAPI Initiative', 45 | reply_to: 'info@asyncapi.io', 46 | } 47 | }); 48 | } catch (error) { 49 | return core.setFailed(`Failed creating campaign: ${ JSON.stringify(error) }`); 50 | } 51 | 52 | /* 53 | * Content of the email is added separately after campaign creation 54 | */ 55 | try { 56 | await mailchimp.campaigns.setContent(newCampaign.id, { html: htmlContent(link, title) }); 57 | } catch (error) { 58 | return core.setFailed(`Failed adding content to campaign: ${ JSON.stringify(error) }`); 59 | } 60 | 61 | /* 62 | * We schedule an email to send it immediately 63 | */ 64 | try { 65 | //schedule for next hour 66 | //so if this code was created by new issue creation at 9:46, the email is scheduled for 10:00 67 | //is it like this as schedule has limitiations and you cannot schedule email for 9:48 68 | const scheduleDate = new Date(Date.parse(new Date(Date.now()).toISOString()) + 1 * 1 * 60 * 60 * 1000); 69 | scheduleDate.setUTCMinutes(00); 70 | 71 | await mailchimp.campaigns.schedule(newCampaign.id, { 72 | schedule_time: scheduleDate.toISOString(), 73 | }); 74 | } catch (error) { 75 | return core.setFailed(`Failed scheduling email: ${ JSON.stringify(error) }`); 76 | } 77 | 78 | core.info(`New email campaign created`); 79 | } -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "schedule-email", 3 | "lockfileVersion": 2, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "name": "schedule-email", 8 | "license": "Apache 2.0", 9 | "dependencies": { 10 | "@actions/core": "1.6.0", 11 | "@mailchimp/mailchimp_marketing": "3.0.74" 12 | } 13 | }, 14 | "node_modules/@actions/core": { 15 | "version": "1.6.0", 16 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", 17 | "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", 18 | "dependencies": { 19 | "@actions/http-client": "^1.0.11" 20 | } 21 | }, 22 | "node_modules/@actions/http-client": { 23 | "version": "1.0.11", 24 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", 25 | "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", 26 | "dependencies": { 27 | "tunnel": "0.0.6" 28 | } 29 | }, 30 | "node_modules/@mailchimp/mailchimp_marketing": { 31 | "version": "3.0.74", 32 | "resolved": "https://registry.npmjs.org/@mailchimp/mailchimp_marketing/-/mailchimp_marketing-3.0.74.tgz", 33 | "integrity": "sha512-039iu4GRr7wpXqweBLuS05wvOBtPxSa31cjxgftBYSt7031f0sHEi8Up2DicfbSuQK0AynPDeVyuxrb31Lx+yQ==", 34 | "dependencies": { 35 | "dotenv": "^8.2.0", 36 | "superagent": "3.8.1" 37 | }, 38 | "engines": { 39 | "node": ">=10.0.0" 40 | } 41 | }, 42 | "node_modules/asynckit": { 43 | "version": "0.4.0", 44 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 45 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 46 | }, 47 | "node_modules/call-bind": { 48 | "version": "1.0.2", 49 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 50 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 51 | "dependencies": { 52 | "function-bind": "^1.1.1", 53 | "get-intrinsic": "^1.0.2" 54 | }, 55 | "funding": { 56 | "url": "https://github.com/sponsors/ljharb" 57 | } 58 | }, 59 | "node_modules/combined-stream": { 60 | "version": "1.0.8", 61 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 62 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 63 | "dependencies": { 64 | "delayed-stream": "~1.0.0" 65 | }, 66 | "engines": { 67 | "node": ">= 0.8" 68 | } 69 | }, 70 | "node_modules/component-emitter": { 71 | "version": "1.3.0", 72 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", 73 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" 74 | }, 75 | "node_modules/cookiejar": { 76 | "version": "2.1.3", 77 | "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", 78 | "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" 79 | }, 80 | "node_modules/core-util-is": { 81 | "version": "1.0.3", 82 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", 83 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" 84 | }, 85 | "node_modules/delayed-stream": { 86 | "version": "1.0.0", 87 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 88 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 89 | "engines": { 90 | "node": ">=0.4.0" 91 | } 92 | }, 93 | "node_modules/dotenv": { 94 | "version": "8.6.0", 95 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", 96 | "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", 97 | "engines": { 98 | "node": ">=10" 99 | } 100 | }, 101 | "node_modules/extend": { 102 | "version": "3.0.2", 103 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 104 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 105 | }, 106 | "node_modules/form-data": { 107 | "version": "2.5.1", 108 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", 109 | "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", 110 | "dependencies": { 111 | "asynckit": "^0.4.0", 112 | "combined-stream": "^1.0.6", 113 | "mime-types": "^2.1.12" 114 | }, 115 | "engines": { 116 | "node": ">= 0.12" 117 | } 118 | }, 119 | "node_modules/formidable": { 120 | "version": "1.2.6", 121 | "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz", 122 | "integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==", 123 | "deprecated": "Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau", 124 | "funding": { 125 | "url": "https://ko-fi.com/tunnckoCore/commissions" 126 | } 127 | }, 128 | "node_modules/function-bind": { 129 | "version": "1.1.1", 130 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 131 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 132 | }, 133 | "node_modules/get-intrinsic": { 134 | "version": "1.1.1", 135 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", 136 | "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", 137 | "dependencies": { 138 | "function-bind": "^1.1.1", 139 | "has": "^1.0.3", 140 | "has-symbols": "^1.0.1" 141 | }, 142 | "funding": { 143 | "url": "https://github.com/sponsors/ljharb" 144 | } 145 | }, 146 | "node_modules/has": { 147 | "version": "1.0.3", 148 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 149 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 150 | "dependencies": { 151 | "function-bind": "^1.1.1" 152 | }, 153 | "engines": { 154 | "node": ">= 0.4.0" 155 | } 156 | }, 157 | "node_modules/has-symbols": { 158 | "version": "1.0.3", 159 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 160 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 161 | "engines": { 162 | "node": ">= 0.4" 163 | }, 164 | "funding": { 165 | "url": "https://github.com/sponsors/ljharb" 166 | } 167 | }, 168 | "node_modules/inherits": { 169 | "version": "2.0.4", 170 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 171 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 172 | }, 173 | "node_modules/isarray": { 174 | "version": "1.0.0", 175 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 176 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 177 | }, 178 | "node_modules/methods": { 179 | "version": "1.1.2", 180 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 181 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", 182 | "engines": { 183 | "node": ">= 0.6" 184 | } 185 | }, 186 | "node_modules/mime": { 187 | "version": "1.6.0", 188 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 189 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 190 | "bin": { 191 | "mime": "cli.js" 192 | }, 193 | "engines": { 194 | "node": ">=4" 195 | } 196 | }, 197 | "node_modules/mime-db": { 198 | "version": "1.52.0", 199 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 200 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 201 | "engines": { 202 | "node": ">= 0.6" 203 | } 204 | }, 205 | "node_modules/mime-types": { 206 | "version": "2.1.35", 207 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 208 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 209 | "dependencies": { 210 | "mime-db": "1.52.0" 211 | }, 212 | "engines": { 213 | "node": ">= 0.6" 214 | } 215 | }, 216 | "node_modules/ms": { 217 | "version": "2.1.3", 218 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 219 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 220 | }, 221 | "node_modules/object-inspect": { 222 | "version": "1.12.0", 223 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", 224 | "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", 225 | "funding": { 226 | "url": "https://github.com/sponsors/ljharb" 227 | } 228 | }, 229 | "node_modules/process-nextick-args": { 230 | "version": "2.0.1", 231 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 232 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 233 | }, 234 | "node_modules/qs": { 235 | "version": "6.10.3", 236 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", 237 | "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", 238 | "dependencies": { 239 | "side-channel": "^1.0.4" 240 | }, 241 | "engines": { 242 | "node": ">=0.6" 243 | }, 244 | "funding": { 245 | "url": "https://github.com/sponsors/ljharb" 246 | } 247 | }, 248 | "node_modules/readable-stream": { 249 | "version": "2.3.7", 250 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 251 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 252 | "dependencies": { 253 | "core-util-is": "~1.0.0", 254 | "inherits": "~2.0.3", 255 | "isarray": "~1.0.0", 256 | "process-nextick-args": "~2.0.0", 257 | "safe-buffer": "~5.1.1", 258 | "string_decoder": "~1.1.1", 259 | "util-deprecate": "~1.0.1" 260 | } 261 | }, 262 | "node_modules/readable-stream/node_modules/safe-buffer": { 263 | "version": "5.1.2", 264 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 265 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 266 | }, 267 | "node_modules/side-channel": { 268 | "version": "1.0.4", 269 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 270 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 271 | "dependencies": { 272 | "call-bind": "^1.0.0", 273 | "get-intrinsic": "^1.0.2", 274 | "object-inspect": "^1.9.0" 275 | }, 276 | "funding": { 277 | "url": "https://github.com/sponsors/ljharb" 278 | } 279 | }, 280 | "node_modules/string_decoder": { 281 | "version": "1.1.1", 282 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 283 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 284 | "dependencies": { 285 | "safe-buffer": "~5.1.0" 286 | } 287 | }, 288 | "node_modules/string_decoder/node_modules/safe-buffer": { 289 | "version": "5.1.2", 290 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 291 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 292 | }, 293 | "node_modules/superagent": { 294 | "version": "3.8.1", 295 | "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.1.tgz", 296 | "integrity": "sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==", 297 | "deprecated": "Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at .", 298 | "dependencies": { 299 | "component-emitter": "^1.2.0", 300 | "cookiejar": "^2.1.0", 301 | "debug": "^3.1.0", 302 | "extend": "^3.0.0", 303 | "form-data": "^2.3.1", 304 | "formidable": "^1.1.1", 305 | "methods": "^1.1.1", 306 | "mime": "^1.4.1", 307 | "qs": "^6.5.1", 308 | "readable-stream": "^2.0.5" 309 | }, 310 | "engines": { 311 | "node": ">= 4.0" 312 | } 313 | }, 314 | "node_modules/superagent/node_modules/debug": { 315 | "version": "3.2.7", 316 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 317 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 318 | "dependencies": { 319 | "ms": "^2.1.1" 320 | } 321 | }, 322 | "node_modules/tunnel": { 323 | "version": "0.0.6", 324 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 325 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", 326 | "engines": { 327 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 328 | } 329 | }, 330 | "node_modules/util-deprecate": { 331 | "version": "1.0.2", 332 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 333 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 334 | } 335 | }, 336 | "dependencies": { 337 | "@actions/core": { 338 | "version": "1.6.0", 339 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", 340 | "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", 341 | "requires": { 342 | "@actions/http-client": "^1.0.11" 343 | } 344 | }, 345 | "@actions/http-client": { 346 | "version": "1.0.11", 347 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", 348 | "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", 349 | "requires": { 350 | "tunnel": "0.0.6" 351 | } 352 | }, 353 | "@mailchimp/mailchimp_marketing": { 354 | "version": "3.0.74", 355 | "resolved": "https://registry.npmjs.org/@mailchimp/mailchimp_marketing/-/mailchimp_marketing-3.0.74.tgz", 356 | "integrity": "sha512-039iu4GRr7wpXqweBLuS05wvOBtPxSa31cjxgftBYSt7031f0sHEi8Up2DicfbSuQK0AynPDeVyuxrb31Lx+yQ==", 357 | "requires": { 358 | "dotenv": "^8.2.0", 359 | "superagent": "3.8.1" 360 | } 361 | }, 362 | "asynckit": { 363 | "version": "0.4.0", 364 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 365 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 366 | }, 367 | "call-bind": { 368 | "version": "1.0.2", 369 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 370 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 371 | "requires": { 372 | "function-bind": "^1.1.1", 373 | "get-intrinsic": "^1.0.2" 374 | } 375 | }, 376 | "combined-stream": { 377 | "version": "1.0.8", 378 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 379 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 380 | "requires": { 381 | "delayed-stream": "~1.0.0" 382 | } 383 | }, 384 | "component-emitter": { 385 | "version": "1.3.0", 386 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", 387 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" 388 | }, 389 | "cookiejar": { 390 | "version": "2.1.3", 391 | "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", 392 | "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" 393 | }, 394 | "core-util-is": { 395 | "version": "1.0.3", 396 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", 397 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" 398 | }, 399 | "delayed-stream": { 400 | "version": "1.0.0", 401 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 402 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 403 | }, 404 | "dotenv": { 405 | "version": "8.6.0", 406 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", 407 | "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==" 408 | }, 409 | "extend": { 410 | "version": "3.0.2", 411 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 412 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 413 | }, 414 | "form-data": { 415 | "version": "2.5.1", 416 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", 417 | "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", 418 | "requires": { 419 | "asynckit": "^0.4.0", 420 | "combined-stream": "^1.0.6", 421 | "mime-types": "^2.1.12" 422 | } 423 | }, 424 | "formidable": { 425 | "version": "1.2.6", 426 | "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz", 427 | "integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==" 428 | }, 429 | "function-bind": { 430 | "version": "1.1.1", 431 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 432 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 433 | }, 434 | "get-intrinsic": { 435 | "version": "1.1.1", 436 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", 437 | "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", 438 | "requires": { 439 | "function-bind": "^1.1.1", 440 | "has": "^1.0.3", 441 | "has-symbols": "^1.0.1" 442 | } 443 | }, 444 | "has": { 445 | "version": "1.0.3", 446 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 447 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 448 | "requires": { 449 | "function-bind": "^1.1.1" 450 | } 451 | }, 452 | "has-symbols": { 453 | "version": "1.0.3", 454 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 455 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" 456 | }, 457 | "inherits": { 458 | "version": "2.0.4", 459 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 460 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 461 | }, 462 | "isarray": { 463 | "version": "1.0.0", 464 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 465 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 466 | }, 467 | "methods": { 468 | "version": "1.1.2", 469 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 470 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 471 | }, 472 | "mime": { 473 | "version": "1.6.0", 474 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 475 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 476 | }, 477 | "mime-db": { 478 | "version": "1.52.0", 479 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 480 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" 481 | }, 482 | "mime-types": { 483 | "version": "2.1.35", 484 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 485 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 486 | "requires": { 487 | "mime-db": "1.52.0" 488 | } 489 | }, 490 | "ms": { 491 | "version": "2.1.3", 492 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 493 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 494 | }, 495 | "object-inspect": { 496 | "version": "1.12.0", 497 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", 498 | "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" 499 | }, 500 | "process-nextick-args": { 501 | "version": "2.0.1", 502 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 503 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 504 | }, 505 | "qs": { 506 | "version": "6.10.3", 507 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", 508 | "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", 509 | "requires": { 510 | "side-channel": "^1.0.4" 511 | } 512 | }, 513 | "readable-stream": { 514 | "version": "2.3.7", 515 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 516 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 517 | "requires": { 518 | "core-util-is": "~1.0.0", 519 | "inherits": "~2.0.3", 520 | "isarray": "~1.0.0", 521 | "process-nextick-args": "~2.0.0", 522 | "safe-buffer": "~5.1.1", 523 | "string_decoder": "~1.1.1", 524 | "util-deprecate": "~1.0.1" 525 | }, 526 | "dependencies": { 527 | "safe-buffer": { 528 | "version": "5.1.2", 529 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 530 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 531 | } 532 | } 533 | }, 534 | "side-channel": { 535 | "version": "1.0.4", 536 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 537 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 538 | "requires": { 539 | "call-bind": "^1.0.0", 540 | "get-intrinsic": "^1.0.2", 541 | "object-inspect": "^1.9.0" 542 | } 543 | }, 544 | "string_decoder": { 545 | "version": "1.1.1", 546 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 547 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 548 | "requires": { 549 | "safe-buffer": "~5.1.0" 550 | }, 551 | "dependencies": { 552 | "safe-buffer": { 553 | "version": "5.1.2", 554 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 555 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 556 | } 557 | } 558 | }, 559 | "superagent": { 560 | "version": "3.8.1", 561 | "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.1.tgz", 562 | "integrity": "sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==", 563 | "requires": { 564 | "component-emitter": "^1.2.0", 565 | "cookiejar": "^2.1.0", 566 | "debug": "^3.1.0", 567 | "extend": "^3.0.0", 568 | "form-data": "^2.3.1", 569 | "formidable": "^1.1.1", 570 | "methods": "^1.1.1", 571 | "mime": "^1.4.1", 572 | "qs": "^6.5.1", 573 | "readable-stream": "^2.0.5" 574 | }, 575 | "dependencies": { 576 | "debug": { 577 | "version": "3.2.7", 578 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 579 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 580 | "requires": { 581 | "ms": "^2.1.1" 582 | } 583 | } 584 | } 585 | }, 586 | "tunnel": { 587 | "version": "0.0.6", 588 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 589 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" 590 | }, 591 | "util-deprecate": { 592 | "version": "1.0.2", 593 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 594 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 595 | } 596 | } 597 | } -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "schedule-email", 3 | "description": "This code is responsible for scheduling an email campaign. This file is centrally managed in https://github.com/asyncapi/.github/", 4 | "license": "Apache 2.0", 5 | "dependencies": { 6 | "@actions/core": "1.6.0", 7 | "@mailchimp/mailchimp_marketing": "3.0.74" 8 | } 9 | } -------------------------------------------------------------------------------- /.github/workflows/stale-issues-prs.yml: -------------------------------------------------------------------------------- 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 | if: startsWith(github.repository, 'asyncapi/') 13 | name: Mark issue or PR as stale 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/stale@99b6c709598e2b0d0841cd037aaf1ba07a4410bd #v5.2.0 but pointing to commit for security reasons 17 | with: 18 | repo-token: ${{ secrets.GITHUB_TOKEN }} 19 | stale-issue-message: | 20 | This issue has been automatically marked as stale because it has not had recent activity :sleeping: 21 | 22 | It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. 23 | 24 | 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). 25 | 26 | 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. 27 | 28 | Thank you for your patience :heart: 29 | stale-pr-message: | 30 | This pull request has been automatically marked as stale because it has not had recent activity :sleeping: 31 | 32 | It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. 33 | 34 | 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). 35 | 36 | 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. 37 | 38 | Thank you for your patience :heart: 39 | days-before-stale: 120 40 | days-before-close: 120 41 | stale-issue-label: stale 42 | stale-pr-label: stale 43 | exempt-issue-labels: keep-open 44 | exempt-pr-labels: keep-open 45 | close-issue-reason: not_planned 46 | -------------------------------------------------------------------------------- /.github/workflows/test-action.yml: -------------------------------------------------------------------------------- 1 | name: PR testing of CLI action 2 | 3 | on: 4 | pull_request: 5 | types: [ opened, synchronize, reopened, ready_for_review ] 6 | 7 | jobs: 8 | should-workflow-run: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - if: > 12 | !github.event.pull_request.draft && !( 13 | (github.actor == 'asyncapi-bot' && ( 14 | startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || 15 | startsWith(github.event.pull_request.title, 'chore(release):') 16 | )) || 17 | (github.actor == 'asyncapi-bot-eve' && ( 18 | startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || 19 | startsWith(github.event.pull_request.title, 'chore(release):') 20 | )) || 21 | (github.actor == 'allcontributors[bot]' && 22 | startsWith(github.event.pull_request.title, 'docs: add') 23 | ) 24 | ) 25 | id: should_run 26 | name: Should Run 27 | run: echo "shouldrun=true" >> $GITHUB_OUTPUT 28 | outputs: 29 | shouldrun: ${{ steps.should_run.outputs.shouldrun }} 30 | 31 | build-docker: 32 | needs: should-workflow-run 33 | name: Build Docker image 34 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 35 | runs-on: ubuntu-latest 36 | steps: 37 | - uses: actions/checkout@v4 38 | - name: Get docker version 39 | id: docker_version 40 | run: > 41 | ls -la; 42 | action=$(cat action.yml); 43 | regex='docker:\/\/asyncapi\/github-action-for-cli:([0-9.]+)'; 44 | [[ $action =~ $regex ]]; 45 | action_version=${BASH_REMATCH[1]}; 46 | echo "action_version=$action_version" >> $GITHUB_OUTPUT 47 | - name: Set up Docker Buildx 48 | uses: docker/setup-buildx-action@v3 49 | - name: Build Docker image and export 50 | uses: docker/build-push-action@v5 51 | with: 52 | context: . 53 | tags: asyncapi/github-action-for-cli:${{ steps.docker_version.outputs.action_version }} 54 | outputs: type=docker,dest=/tmp/asyncapi.tar 55 | - name: Upload artifact 56 | uses: actions/upload-artifact@v3 57 | with: 58 | name: asyncapi 59 | path: /tmp/asyncapi.tar 60 | 61 | 62 | test-defaults: 63 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 64 | runs-on: ubuntu-latest 65 | needs: [should-workflow-run, build-docker] 66 | steps: 67 | - name: Download artifact 68 | uses: actions/download-artifact@v3 69 | with: 70 | name: asyncapi 71 | path: /tmp 72 | - name: Load Docker image 73 | run: | 74 | docker load --input /tmp/asyncapi.tar 75 | docker image ls -a 76 | - uses: actions/checkout@v4 77 | - name: Test GitHub Action 78 | uses: ./ 79 | with: 80 | filepath: test/asyncapi.yml 81 | - name: Assert GitHub Action 82 | run: | 83 | echo "Listing all files" 84 | ls -R 85 | echo "Asserting GitHub Action" 86 | if [ -f "./output/asyncapi.md" ]; then 87 | echo "Files exist" 88 | else 89 | echo "Files do not exist:- ./output/asyncapi.md" 90 | echo "Action failed" 91 | exit 1 92 | fi 93 | 94 | test-validate-success: 95 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 96 | runs-on: ubuntu-latest 97 | needs: [should-workflow-run, build-docker] 98 | steps: 99 | - name: Download artifact 100 | uses: actions/download-artifact@v3 101 | with: 102 | name: asyncapi 103 | path: /tmp 104 | - name: Load Docker image 105 | run: | 106 | docker load --input /tmp/asyncapi.tar 107 | docker image ls -a 108 | - uses: actions/checkout@v4 109 | - name: Test GitHub Action 110 | uses: ./ 111 | with: 112 | filepath: test/asyncapi.yml 113 | command: validate 114 | 115 | test-custom-command: 116 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 117 | runs-on: ubuntu-latest 118 | needs: [should-workflow-run, build-docker] 119 | steps: 120 | - name: Download artifact 121 | uses: actions/download-artifact@v3 122 | with: 123 | name: asyncapi 124 | path: /tmp 125 | - name: Load Docker image 126 | run: | 127 | docker load --input /tmp/asyncapi.tar 128 | docker image ls -a 129 | - uses: actions/checkout@v4 130 | - name: Test GitHub Action 131 | uses: ./ 132 | with: 133 | # Custom command to generate models 134 | # Note: You can use command itself to generate models, but this is just an example for testing custom commands 135 | custom_command: "generate models typescript ./test/asyncapi.yml -o ./output" 136 | - name: Assert GitHub Action 137 | run: | 138 | echo "Listing all files" 139 | ls -R 140 | echo "Asserting GitHub Action" 141 | if [ -f "./output/AnonymousSchema_1.ts" ]; then 142 | echo "Models have been generated" 143 | else 144 | echo "Models have not been generated" 145 | echo "Action failed" 146 | exit 1 147 | fi 148 | 149 | test-custom-output: 150 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 151 | runs-on: ubuntu-latest 152 | needs: [should-workflow-run, build-docker] 153 | steps: 154 | - name: Download artifact 155 | uses: actions/download-artifact@v3 156 | with: 157 | name: asyncapi 158 | path: /tmp 159 | - name: Load Docker image 160 | run: | 161 | docker load --input /tmp/asyncapi.tar 162 | docker image ls -a 163 | - uses: actions/checkout@v4 164 | - name: Test GitHub Action 165 | uses: ./ 166 | with: 167 | filepath: test/asyncapi.yml 168 | output: custom-output 169 | - name: Assert GitHub Action 170 | run: | 171 | echo "Listing all files" 172 | ls -R 173 | echo "Asserting GitHub Action" 174 | if [ -f "./custom-output/asyncapi.md" ]; then 175 | echo "Files exist" 176 | else 177 | echo "Files do not exist:- ./custom-output/asyncapi.md" 178 | echo "Action failed" 179 | exit 1 180 | fi 181 | 182 | test-file-not-found: 183 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 184 | runs-on: ubuntu-latest 185 | needs: [should-workflow-run, build-docker] 186 | steps: 187 | - name: Download artifact 188 | uses: actions/download-artifact@v3 189 | with: 190 | name: asyncapi 191 | path: /tmp 192 | - name: Load Docker image 193 | run: | 194 | docker load --input /tmp/asyncapi.tar 195 | docker image ls -a 196 | - uses: actions/checkout@v4 197 | - name: Test GitHub Action 198 | id: test 199 | uses: ./ 200 | with: 201 | filepath: non_existent_file.yml 202 | continue-on-error: true 203 | - name: Check for failure 204 | run: | 205 | if [ "${{ steps.test.outcome }}" == "success" ]; then 206 | echo "Test Failure: non_existent_file.yml should throw an error but did not" 207 | exit 1 208 | else 209 | echo "Test Success: non_existent_file.yml threw an error as expected" 210 | fi 211 | 212 | test-invalid-input: 213 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 214 | runs-on: ubuntu-latest 215 | needs: [should-workflow-run, build-docker] 216 | steps: 217 | - name: Download artifact 218 | uses: actions/download-artifact@v3 219 | with: 220 | name: asyncapi 221 | path: /tmp 222 | - name: Load Docker image 223 | run: | 224 | docker load --input /tmp/asyncapi.tar 225 | docker image ls -a 226 | - uses: actions/checkout@v4 227 | - name: Test GitHub Action 228 | id: test 229 | uses: ./ 230 | with: 231 | filepath: test/asyncapi.yml 232 | command: generate # No template or language specified 233 | template: '' # Empty string 234 | continue-on-error: true 235 | - name: Check for failure 236 | run: | 237 | if [ "${{ steps.test.outcome }}" == "success" ]; then 238 | echo "Test Failure: generate command should throw an error as no template or language specified but did not" 239 | exit 1 240 | else 241 | echo "Test Success: generate command threw an error as expected" 242 | fi 243 | 244 | test-optimize: 245 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 246 | runs-on: ubuntu-latest 247 | needs: [should-workflow-run, build-docker] 248 | steps: 249 | - name: Download artifact 250 | uses: actions/download-artifact@v3 251 | with: 252 | name: asyncapi 253 | path: /tmp 254 | - name: Load Docker image 255 | run: | 256 | docker load --input /tmp/asyncapi.tar 257 | docker image ls -a 258 | - uses: actions/checkout@v4 259 | - name: Test GitHub Action 260 | uses: ./ 261 | with: 262 | filepath: test/unoptimized.yml 263 | command: optimize 264 | parameters: '-o new-file --no-tty' 265 | - name: Assert GitHub Action 266 | run: | 267 | echo "Listing all files" 268 | ls -R 269 | echo "Asserting GitHub Action" 270 | if [ -f "./test/unoptimized_optimized.yml" ]; then 271 | echo "The specified file has been optimized" 272 | else 273 | echo "The specified file has not been optimized" 274 | echo "Action failed" 275 | exit 1 276 | fi 277 | 278 | test-bundle: 279 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 280 | runs-on: ubuntu-latest 281 | needs: [should-workflow-run, build-docker] 282 | steps: 283 | - name: Download artifact 284 | uses: actions/download-artifact@v3 285 | with: 286 | name: asyncapi 287 | path: /tmp 288 | - name: Load Docker image 289 | run: | 290 | docker load --input /tmp/asyncapi.tar 291 | docker image ls -a 292 | - uses: actions/checkout@v4 293 | - name: Make output directory 294 | run: mkdir -p ./output/bundle 295 | - name: Test GitHub Action 296 | uses: ./ 297 | with: 298 | custom_command: 'bundle ./test/bundle/asyncapi.yaml ./test/bundle/features.yaml --base ./test/bundle/asyncapi.yaml -o ./output/bundle/asyncapi.yaml' 299 | - name: Assert GitHub Action 300 | run: | 301 | echo "Listing all files" 302 | ls -R 303 | echo "Asserting GitHub Action" 304 | if [ -f "./output/bundle/asyncapi.yaml" ]; then 305 | echo "The specified files have been bundled" 306 | else 307 | echo "The specified files have not been bundled" 308 | echo "Action failed" 309 | exit 1 310 | fi 311 | 312 | test-convert: 313 | if: ${{ needs.should-workflow-run.outputs.shouldrun == 'true' }} 314 | runs-on: ubuntu-latest 315 | needs: [should-workflow-run, build-docker] 316 | steps: 317 | - name: Download artifact 318 | uses: actions/download-artifact@v3 319 | with: 320 | name: asyncapi 321 | path: /tmp 322 | - name: Load Docker image 323 | run: | 324 | docker load --input /tmp/asyncapi.tar 325 | docker image ls -a 326 | - uses: actions/checkout@v4 327 | - name: Test GitHub Action 328 | uses: ./ 329 | with: 330 | command: convert 331 | filepath: test/asyncapi.yml 332 | output: output/convert/asyncapi.yaml 333 | - name: Assert GitHub Action 334 | run: | 335 | echo "Listing all files" 336 | ls -R 337 | echo "Asserting GitHub Action" 338 | if [ -f "./output/convert/asyncapi.yaml" ]; then 339 | echo "The specified file has been converted" 340 | else 341 | echo "The specified file has not been converted" 342 | echo "Action failed" 343 | exit 1 344 | fi -------------------------------------------------------------------------------- /.github/workflows/update-pr.yml: -------------------------------------------------------------------------------- 1 | # This workflow 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 workflow will run on every comment with /update or /u. And will create merge-commits for the PR. 5 | # This also works with forks, not only with branches in the same repository/organization. 6 | # Currently, does not work with forks in different organizations. 7 | 8 | # This workflow will be distributed to all repositories in the AsyncAPI organization 9 | 10 | name: Update PR branches from fork 11 | 12 | on: 13 | issue_comment: 14 | types: [created] 15 | 16 | jobs: 17 | update-pr: 18 | if: > 19 | startsWith(github.repository, 'asyncapi/') && 20 | github.event.issue.pull_request && 21 | github.event.issue.state != 'closed' && ( 22 | contains(github.event.comment.body, '/update') || 23 | contains(github.event.comment.body, '/u') 24 | ) 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Get Pull Request Details 28 | id: pr 29 | uses: actions/github-script@v7 30 | with: 31 | github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} 32 | previews: 'merge-info-preview' # https://docs.github.com/en/graphql/overview/schema-previews#merge-info-preview-more-detailed-information-about-a-pull-requests-merge-state-preview 33 | script: | 34 | const prNumber = context.payload.issue.number; 35 | core.debug(`PR Number: ${prNumber}`); 36 | const { data: pr } = await github.rest.pulls.get({ 37 | owner: context.repo.owner, 38 | repo: context.repo.repo, 39 | pull_number: prNumber 40 | }); 41 | 42 | // If the PR has conflicts, we don't want to update it 43 | const updateable = ['behind', 'blocked', 'unknown', 'draft', 'clean'].includes(pr.mergeable_state); 44 | console.log(`PR #${prNumber} is ${pr.mergeable_state} and is ${updateable ? 'updateable' : 'not updateable'}`); 45 | core.setOutput('updateable', updateable); 46 | 47 | core.debug(`Updating PR #${prNumber} with head ${pr.head.sha}`); 48 | 49 | return { 50 | id: pr.node_id, 51 | number: prNumber, 52 | head: pr.head.sha, 53 | } 54 | - name: Update the Pull Request 55 | if: steps.pr.outputs.updateable == 'true' 56 | uses: actions/github-script@v7 57 | with: 58 | github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} 59 | script: | 60 | const mutation = `mutation update($input: UpdatePullRequestBranchInput!) { 61 | updatePullRequestBranch(input: $input) { 62 | pullRequest { 63 | mergeable 64 | } 65 | } 66 | }`; 67 | 68 | const pr_details = ${{ steps.pr.outputs.result }}; 69 | 70 | try { 71 | const { data } = await github.graphql(mutation, { 72 | input: { 73 | pullRequestId: pr_details.id, 74 | expectedHeadOid: pr_details.head, 75 | } 76 | }); 77 | } catch (GraphQLError) { 78 | core.debug(GraphQLError); 79 | if ( 80 | GraphQLError.name === 'GraphqlResponseError' && 81 | GraphQLError.errors.some( 82 | error => error.type === 'FORBIDDEN' || error.type === 'UNAUTHORIZED' 83 | ) 84 | ) { 85 | // Add comment to PR if the bot doesn't have permissions to update the PR 86 | const comment = `Hi @${context.actor}. Update of PR has failed. It can be due to one of the following reasons: 87 | - I don't have permissions to update this PR. To update your fork with upstream using bot you need to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in the PR. 88 | - The fork is located in an organization, not under your personal profile. No solution for that. You are on your own with manual update. 89 | - There may be a conflict in the PR. Please resolve the conflict and try again.`; 90 | 91 | await github.rest.issues.createComment({ 92 | owner: context.repo.owner, 93 | repo: context.repo.repo, 94 | issue_number: context.issue.number, 95 | body: comment 96 | }); 97 | 98 | core.setFailed('Bot does not have permissions to update the PR'); 99 | } else { 100 | core.setFailed(GraphQLError.message); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /.github/workflows/welcome-first-time-contrib.yml: -------------------------------------------------------------------------------- 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 | name: Post welcome message 17 | if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }} 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/github-script@v6 21 | with: 22 | github-token: ${{ secrets.GITHUB_TOKEN }} 23 | script: | 24 | 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/community/blob/master/git-workflow.md) useful for opening a pull request.
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).`; 25 | 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.
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).`; 26 | if (!issueMessage && !prMessage) { 27 | throw new Error('Action must have at least one of issue-message or pr-message set'); 28 | } 29 | const isIssue = !!context.payload.issue; 30 | let isFirstContribution; 31 | if (isIssue) { 32 | const query = `query($owner:String!, $name:String!, $contributer:String!) { 33 | repository(owner:$owner, name:$name){ 34 | issues(first: 1, filterBy: {createdBy:$contributer}){ 35 | totalCount 36 | } 37 | } 38 | }`; 39 | const variables = { 40 | owner: context.repo.owner, 41 | name: context.repo.repo, 42 | contributer: context.payload.sender.login 43 | }; 44 | const { repository: { issues: { totalCount } } } = await github.graphql(query, variables); 45 | isFirstContribution = totalCount === 1; 46 | } else { 47 | const query = `query($qstr: String!) { 48 | search(query: $qstr, type: ISSUE, first: 1) { 49 | issueCount 50 | } 51 | }`; 52 | const variables = { 53 | "qstr": `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${context.payload.sender.login}`, 54 | }; 55 | const { search: { issueCount } } = await github.graphql(query, variables); 56 | isFirstContribution = issueCount === 1; 57 | } 58 | 59 | if (!isFirstContribution) { 60 | console.log(`Not the users first contribution.`); 61 | return; 62 | } 63 | const message = isIssue ? issueMessage : prMessage; 64 | // Add a comment to the appropriate place 65 | if (isIssue) { 66 | const issueNumber = context.payload.issue.number; 67 | console.log(`Adding message: ${message} to issue #${issueNumber}`); 68 | await github.rest.issues.createComment({ 69 | owner: context.payload.repository.owner.login, 70 | repo: context.payload.repository.name, 71 | issue_number: issueNumber, 72 | body: message 73 | }); 74 | } 75 | else { 76 | const pullNumber = context.payload.pull_request.number; 77 | console.log(`Adding message: ${message} to pull request #${pullNumber}`); 78 | await github.rest.pulls.createReview({ 79 | owner: context.payload.repository.owner.login, 80 | repo: context.payload.repository.name, 81 | pull_number: pullNumber, 82 | body: message, 83 | event: 'COMMENT' 84 | }); 85 | } 86 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | .DS_Store 3 | output 4 | node_modules 5 | dist 6 | test/unoptimized_optimized.yml -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | --- 2 | branches: 3 | - master 4 | # by default release workflow reacts on push not only to master. 5 | #This is why out of the box sematic release is configured for all these branches 6 | - name: next-spec 7 | prerelease: true 8 | - name: next-major 9 | prerelease: true 10 | - name: next-major-spec 11 | prerelease: true 12 | - name: beta 13 | prerelease: true 14 | - name: alpha 15 | prerelease: true 16 | plugins: 17 | - - "@semantic-release/commit-analyzer" 18 | - preset: conventionalcommits 19 | - - "@semantic-release/release-notes-generator" 20 | - preset: conventionalcommits 21 | - "@semantic-release/github" 22 | -------------------------------------------------------------------------------- /.sonarcloud.properties: -------------------------------------------------------------------------------- 1 | # The dockerfile has been excluded from the SonarCloud as this container is meant to be run on GitHub Actions, hence running with security violation is ok 2 | sonar.exclusions=Dockerfile -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 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 | 9 | * @derberg @magicmatatjahu @asyncapi-bot-eve @Shurtu-gal 10 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | - Using welcoming and inclusive language 12 | - Being respectful of differing viewpoints and experiences 13 | - Gracefully accepting constructive criticism 14 | - Focusing on what is best for the community 15 | - Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | - Trolling, insulting/derogatory comments, and personal or political attacks 21 | - Public or private harassment 22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | - Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at fmvilas@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to AsyncAPI 2 | We love your input! We want to make contributing to this project as easy and transparent as possible. 3 | 4 | ## Contribution recogniton 5 | 6 | We use [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions. For more details read [this](https://github.com/asyncapi/community/blob/master/recognize-contributors.md) document. 7 | 8 | ## Summary of the contribution flow 9 | 10 | The following is a summary of the ideal contribution flow. Please, note that Pull Requests can also be rejected by the maintainers when appropriate. 11 | 12 | ``` 13 | ┌───────────────────────┐ 14 | │ │ 15 | │ Open an issue │ 16 | │ (a bug report or a │ 17 | │ feature request) │ 18 | │ │ 19 | └───────────────────────┘ 20 | ⇩ 21 | ┌───────────────────────┐ 22 | │ │ 23 | │ Open a Pull Request │ 24 | │ (only after issue │ 25 | │ is approved) │ 26 | │ │ 27 | └───────────────────────┘ 28 | ⇩ 29 | ┌───────────────────────┐ 30 | │ │ 31 | │ Your changes will │ 32 | │ be merged and │ 33 | │ published on the next │ 34 | │ release │ 35 | │ │ 36 | └───────────────────────┘ 37 | ``` 38 | 39 | ## Code of Conduct 40 | AsyncAPI has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](./CODE_OF_CONDUCT.md) so that you can understand what sort of behaviour is expected. 41 | 42 | ## Our Development Process 43 | We use Github to host code, to track issues and feature requests, as well as accept pull requests. 44 | 45 | ## Issues 46 | [Open an issue](https://github.com/asyncapi/asyncapi/issues/new) **only** if you want to report a bug or a feature. Don't open issues for questions or support, instead join our [Slack workspace](https://www.asyncapi.com/slack-invite) and ask there. Don't forget to follow our [Slack Etiquette](https://github.com/asyncapi/community/blob/master/slack-etiquette.md) while interacting with community members! It's more likely you'll get help, and much faster! 47 | 48 | ## Bug Reports and Feature Requests 49 | 50 | Please use our issues templates that provide you with hints on what information we need from you to help you out. 51 | 52 | ## Pull Requests 53 | 54 | **Please, make sure you open an issue before starting with a Pull Request, unless it's a typo or a really obvious error.** Pull requests are the best way to propose changes to the specification. Get familiar with our document that explains [Git workflow](https://github.com/asyncapi/community/blob/master/git-workflow.md) used in our repositories. 55 | 56 | ## Conventional commits 57 | 58 | Our repositories follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification. Releasing to GitHub and NPM is done with the support of [semantic-release](https://semantic-release.gitbook.io/semantic-release/). 59 | 60 | Pull requests should have a title that follows the specification, otherwise, merging is blocked. If you are not familiar with the specification simply ask maintainers to modify. You can also use this cheatsheet if you want: 61 | 62 | - `fix: ` prefix in the title indicates that PR is a bug fix and PATCH release must be triggered. 63 | - `feat: ` prefix in the title indicates that PR is a feature and MINOR release must be triggered. 64 | - `docs: ` prefix in the title indicates that PR is only related to the documentation and there is no need to trigger release. 65 | - `chore: ` prefix in the title indicates that PR is only related to cleanup in the project and there is no need to trigger release. 66 | - `test: ` prefix in the title indicates that PR is only related to tests and there is no need to trigger release. 67 | - `refactor: ` prefix in the title indicates that PR is only related to refactoring and there is no need to trigger release. 68 | 69 | What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor!: ` 70 | 71 | Prefix that follows specification is not enough though. Remember that the title must be clear and descriptive with usage of [imperative mood](https://chris.beams.io/posts/git-commit/#imperative). 72 | 73 | Happy contributing :heart: 74 | 75 | ## License 76 | When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](https://github.com/asyncapi/asyncapi/blob/master/LICENSE) that covers the project. Feel free to [contact the maintainers](https://www.asyncapi.com/slack-invite) if that's a concern. 77 | 78 | ## References 79 | This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md). -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-alpine 2 | 3 | # Create a non-root user 4 | RUN addgroup -S myuser && adduser -S myuser -G myuser 5 | 6 | RUN apk add --no-cache bash>5.1.16 git>2.42.0 chromium 7 | 8 | # Environment variables for Puppeteer for PDF generation by HTML Template 9 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 10 | ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser 11 | 12 | # Installing latest released npm package 13 | RUN npm install --ignore-scripts -g @asyncapi/cli 14 | 15 | COPY entrypoint.sh /entrypoint.sh 16 | 17 | # Make the bash file executable 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT ["/entrypoint.sh"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DEFAULT_VERSION = 'latest' 2 | DEFAULT_COMMAND = 'generate' 3 | TEST_FILEPATH = 'test/asyncapi.yml' 4 | DEFAULT_TEMPLATE = '@asyncapi/markdown-template@0.10.0' 5 | DEFAULT_LANGUAGE = '' 6 | DEFAULT_OUTPUT = 'output' 7 | DEFAULT_PARAMETERS = '' 8 | DEFAULT_CUSTOM_COMMANDS = '' 9 | CUSTOM_COMMANDS = 'validate test/asyncapi.yml' 10 | 11 | # Add env variables to the shell 12 | export GITHUB_WORKSPACE = $(shell pwd) 13 | 14 | run: 15 | @bash ./entrypoint.sh $(DEFAULT_VERSION) $(DEFAULT_COMMAND) $(TEST_FILEPATH) $(DEFAULT_TEMPLATE) $(DEFAULT_LANGUAGE) $(DEFAULT_OUTPUT) $(DEFAULT_PARAMETERS) $(DEFAULT_CUSTOM_COMMANDS) 16 | 17 | test: test-default test-validate-success test-custom-output test-custom-commands test-optimize test-bundle test-convert 18 | 19 | # Test cases 20 | 21 | # Tests if the action has been bumped greater than the latest release 22 | test-action-bump: 23 | @bash bump-test.sh 24 | 25 | # Tests the default configuration without any inputs 26 | test-default: 27 | @bash ./entrypoint.sh $(DEFAULT_VERSION) $(DEFAULT_COMMAND) $(TEST_FILEPATH) $(DEFAULT_TEMPLATE) $(DEFAULT_LANGUAGE) $(DEFAULT_OUTPUT) $(DEFAULT_PARAMETERS) $(DEFAULT_CUSTOM_COMMANDS) 28 | 29 | # Tests the validate command with a valid specification 30 | test-validate-success: 31 | @bash ./entrypoint.sh $(DEFAULT_VERSION) 'validate' $(TEST_FILEPATH) $(DEFAULT_TEMPLATE) $(DEFAULT_LANGUAGE) $(DEFAULT_OUTPUT) $(DEFAULT_PARAMETERS) $(DEFAULT_CUSTOM_COMMANDS) 32 | 33 | # Tests the validate command with an invalid specification 34 | test-validate-fail: 35 | @bash ./entrypoint.sh $(DEFAULT_VERSION) 'validate' './test/specification-invalid.yml' $(DEFAULT_TEMPLATE) $(DEFAULT_LANGUAGE) $(DEFAULT_OUTPUT) $(DEFAULT_PARAMETERS) $(DEFAULT_CUSTOM_COMMANDS) 36 | 37 | # Tests if the generator can output to a custom directory 38 | test-custom-output: 39 | @bash ./entrypoint.sh $(DEFAULT_VERSION) $(DEFAULT_COMMAND) $(TEST_FILEPATH) $(DEFAULT_TEMPLATE) 'typescript' './output/custom-output' $(DEFAULT_PARAMETERS) $(DEFAULT_CUSTOM_COMMANDS) 40 | 41 | # Tests if the action prefers custom commands over the default command 42 | test-custom-commands: 43 | @bash ./entrypoint.sh $(DEFAULT_VERSION) $(DEFAULT_COMMAND) $(TEST_FILEPATH) $(DEFAULT_TEMPLATE) 'typescript' './output/custom-output' $(DEFAULT_PARAMETERS) $(CUSTOM_COMMANDS) 44 | 45 | # Tests if the action fails when the input is invalid (e.g. invalid template as is the case here) 46 | fail-test: 47 | @bash ./entrypoint.sh $(DEFAULT_VERSION) $(DEFAULT_COMMAND) $(TEST_FILEPATH) '' $(DEFAULT_LANGUAGE) $(DEFAULT_OUTPUT) $(DEFAULT_PARAMETERS) $(DEFAULT_CUSTOM_COMMANDS) 48 | 49 | # Tests if the action optimizes the specification 50 | test-optimize: 51 | @bash ./entrypoint.sh $(DEFAULT_VERSION) 'optimize' 'test/unoptimized.yml' $(DEFAULT_TEMPLATE) $(DEFAULT_LANGUAGE) $(DEFAULT_OUTPUT) '-o new-file --no-tty' $(DEFAULT_CUSTOM_COMMANDS) 52 | 53 | # Tests if the action can bundle the specification with custom commands 54 | BUNDLE_COMMAND='bundle ./test/bundle/asyncapi.yaml ./test/bundle/features.yaml --base ./test/bundle/asyncapi.yaml -o ./output/bundle/asyncapi.yaml' 55 | test-bundle: 56 | mkdir -p ./output/bundle 57 | @bash ./entrypoint.sh $(DEFAULT_VERSION) 'bundle' 'test/bundle/asyncapi.yaml' $(DEFAULT_TEMPLATE) $(DEFAULT_LANGUAGE) $(DEFAULT_OUTPUT) '-o output/bundle/asyncapi.yaml' $(BUNDLE_COMMAND) 58 | 59 | # Tests if the action can convert the specification with custom commands 60 | test-convert: 61 | @bash ./entrypoint.sh $(DEFAULT_VERSION) 'convert' 'test/asyncapi.yml' $(DEFAULT_TEMPLATE) $(DEFAULT_LANGUAGE) 'output/convert/asyncapi.yaml' '' $(DEFAULT_CUSTOM_COMMANDS) 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitHub Action for CLI 2 | 3 | [![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-) 4 | 5 | 6 | ## Deprecation Notice 7 | > [!IMPORTANT] 8 | > This repository has been **deprecated**. The GitHub Action has been migrated to a new repository for better support and enhancements. 9 | > ### Migration Details 10 | > - The new repository: [asyncapi/cli](https://github.com/asyncapi/cli) 11 | > - Marketplace URL: [AsyncAPI CLI Action](https://github.com/marketplace/actions/asyncapi-cli-action) 12 | > ### What to Update: 13 | > - If you are using `asyncapi/github-action-for-cli` in your workflows, update it to `asyncapi/cli`. 14 | > - Docker-based actions require no changes, but versions are now synced with CLI releases. Refer to [Docker Hub](https://hub.docker.com/r/asyncapi/github-action-for-cli) for details. 15 | > ### Example Migration 16 | > #### Old Workflow: 17 | > ```yaml 18 | > - name: AsyncAPI CLI Action 19 | > uses: asyncapi/github-action-for-cli@v2.0.0 20 | > ``` 21 | > #### New Workflow: 22 | > ```yaml 23 | > - name: AsyncAPI CLI Action 24 | > uses: asyncapi/cli@v2.16.0 25 | >``` 26 | > For further details, stay tuned for official documentation and blog posts explaining the changes and outlining best practices. 27 | 28 | --- 29 | 30 | This action exposes the [AsyncAPI CLI](https://github.com/asyncapi/cli). It allows you to generate documentation, validate AsyncAPI documents, convert between different AsyncAPI versions and much more. 31 | 32 | ## Inputs 33 | 34 | ### `cli_version` 35 | 36 | Version of the AsyncAPI CLI you wish to use. You can find all available versions [here](https://github.com/asyncapi/cli/releases). Recommended leave it out of the inputs and use the default value. 37 | 38 | **Default** points to the`latest` version. 39 | 40 | > [!TIP] 41 | > We recommend to default to `latest` version. This way there is no overhead with the script updating the CLI version. As it takes a lot of time to update the CLI version, we recommend to update it only when you need to use another one for compatibility reasons. 42 | 43 | ### `command` 44 | 45 | Command that you wish to run. You can find all available commands Available commands are: 46 | - `generate` - generates documentation from AsyncAPI document 47 | - `validate` - validates AsyncAPI document 48 | - `optimize` - optimizes AsyncAPI document 49 | - `convert` - converts AsyncAPI document to another version 50 | - `custom` - allows you to run any command that is available in the AsyncAPI CLI. You can find all available commands [here](https://www.asyncapi.com/docs/tools/cli/usage). 51 | 52 | **Default** points to `generate` command. 53 | 54 | > [!IMPORTANT] 55 | > In case you want to use `custom` command, you need to pass an array of commands to the [`custom_command`](#custom_command) input. Although passing command is not required, it is recommended to pass it to avoid any issues later on. 56 | > For example, if you want to run `asyncapi bundle ./asyncapi.yaml --output final-asyncapi.yaml` you need to pass `"bundle ./asyncapi.yaml --output final-asyncapi.yaml" to the `custom_command` input. 57 | 58 | ### `custom_command` 59 | 60 | In case you want to use `custom` command you need to pass the command that you want to run in this input. You can find all available commands [here](https://www.asyncapi.com/docs/tools/cli/usage). 61 | 62 | **Default** points to '' (empty string). 63 | 64 | Sample usage: 65 | 66 | ```yaml 67 | - name: Generating HTML from my AsyncAPI document 68 | uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want 69 | with: 70 | custom_command: bundle ./asyncapi.yaml --output final-asyncapi.yaml 71 | ``` 72 | 73 | > [!CAUTION] 74 | > You have to pass the whole command as a string including the parameters and the command itself. 75 | > It will run like this: `asyncapi ` 76 | 77 | 78 | ### `filepath` 79 | 80 | Path to the AsyncAPI document that you want to process. 81 | 82 | **Default** expects the AsyncAPI document to be in the root of the repository and named `asyncapi.yaml`. 83 | 84 | ### `template` 85 | 86 | Template for the generator. Official templates are listed here https://github.com/asyncapi/generator#list-of-official-generator-templates. You can pass template as npm package, url to git repository, link to tar file or local template. 87 | 88 | **Default** points to `@asyncapi/markdown-template@0.10.0` template. 89 | 90 | > [!TIP] 91 | > We recommend to always specify the version of the template to not encounter any issues with the action in case of release of the template that is not compatible with given version of the generator. 92 | 93 | ### `language` 94 | 95 | Specifies the language to be used for the generated models. The value must be a valid language name supported by [modelina](https://github.com/asyncapi/modelina). 96 | 97 | **Default** is not set. 98 | 99 | > [!WARNING] 100 | > Either `language` or `template` must be set else an error will be thrown. 101 | > The action will return an error if the language is not supported by [modelina](https://github.com/asyncapi/modelina). 102 | 103 | ### `output` 104 | 105 | Path to the output directory. Can be used for `generate` and `convert` commands. 106 | 107 | **Default** points to `output` directory in the root of the repository. 108 | 109 | ### `parameters` 110 | 111 | The command that you use might support and even require specific parameters to be passed to the CLI for the generation. You can find all available parameters [here](https://www.asyncapi.com/docs/tools/cli/usage). 112 | 113 | **Default** points to '' (empty string). 114 | 115 | > [!NOTE] 116 | > For template parameters, you need to pass them as `-p ` as can be seen in CLI documentation. 117 | 118 | 119 | ## Example usage 120 | 121 | > [!WARNING] 122 | > Using `docker://asyncapi/github-action-for-cli` will not work as expected. This is because the GitHub Actions runner does not pass params to the docker image correctly. This is why we recommend to use `asyncapi/github-action-for-cli` instead. 123 | > However, you don't need to worry as it won't build the image every time. It will pull it from Docker Hub as it is already built there. 124 | 125 | ### Basic 126 | 127 | In case all defaults are fine for you, just add such step: 128 | 129 | ```yaml 130 | - name: Generating Markdown from my AsyncAPI document 131 | uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want 132 | ``` 133 | 134 | ### Using all possible inputs 135 | 136 | In case you do not want to use defaults, you for example want to use different template: 137 | 138 | ```yaml 139 | - name: Generating HTML from my AsyncAPI document 140 | uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want 141 | with: 142 | command: generate 143 | filepath: ./docs/api/asyncapi.yaml 144 | template: "@asyncapi/html-template@0.9.0" #In case of template from npm. Or can use a link. 145 | output: ./generated-html 146 | parameters: "-p baseHref=/test-experiment/ sidebarOrganization=byTags" 147 | ``` 148 | > [!IMPORTANT] 149 | > Note the usage of `-p` in `parameters` input. This is required for template parameters, unlike previous versions of this action as the action includes other commands than just `generate`. 150 | 151 | ### Example workflow with publishing generated HTML to GitHub Pages 152 | 153 | In case you want to validate your asyncapi file first, and also send generated HTML to GitHub Pages this is how full workflow could look like: 154 | 155 | ```yaml 156 | name: AsyncAPI documents processing 157 | 158 | on: 159 | push: 160 | branches: [ master ] 161 | 162 | jobs: 163 | generate: 164 | runs-on: ubuntu-latest 165 | steps: 166 | #"standard step" where repo needs to be checked-out first 167 | - name: Checkout repo 168 | uses: actions/checkout@v2 169 | 170 | #In case you do not want to use defaults, you for example want to use different template 171 | - name: Generating HTML from my AsyncAPI document 172 | uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want 173 | with: 174 | template: '@asyncapi/html-template@0.9.0' #In case of template from npm, because of @ it must be in quotes 175 | filepath: docs/api/my-asyncapi.yml 176 | parameters: -p baseHref=/test-experiment/ sidebarOrganization=byTags #space separated list of key/values 177 | output: generated-html 178 | 179 | #Using another action that takes generated HTML and pushes it to GH Pages 180 | - name: Deploy GH page 181 | uses: JamesIves/github-pages-deploy-action@3.4.2 182 | with: 183 | ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} 184 | BRANCH: gh-pages 185 | FOLDER: generated-html 186 | ``` 187 | 188 | ### Example workflow for generating models 189 | 190 | In case you want to use models generated from your AsyncAPI document, you can use this action to generate them and then use them in your workflow. This is how full workflow could look like: 191 | 192 | ```yaml 193 | 194 | name: AsyncAPI documents processing 195 | 196 | on: 197 | push: 198 | branches: [ master ] 199 | 200 | jobs: 201 | generate-models: 202 | runs-on: ubuntu-latest 203 | steps: 204 | #"standard step" where repo needs to be checked-out first 205 | - name: Checkout repo 206 | uses: actions/checkout@v2 207 | 208 | - name: Generating models from my AsyncAPI document 209 | uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want 210 | with: 211 | command: generate 212 | filepath: docs/api/my-asyncapi.yml 213 | language: typescript 214 | output: generated-models 215 | ``` 216 | 217 | ### Example workflow for validating AsyncAPI document changes 218 | 219 | In case you want to validate your AsyncAPI document changes, you can use this action to validate them and then use them in your workflow. This is how full workflow could look like: 220 | 221 | ```yaml 222 | name: Validate AsyncAPI document 223 | 224 | on: 225 | pull_request: 226 | branches: [ master ] 227 | 228 | jobs: 229 | validate: 230 | runs-on: ubuntu-latest 231 | steps: 232 | #"standard step" where repo needs to be checked-out first 233 | - name: Checkout repo 234 | uses: actions/checkout@v2 235 | 236 | - name: Validating AsyncAPI document 237 | uses: asyncapi/github-action-for-cli@v3.1.1 # You can use any version you want 238 | with: 239 | command: validate 240 | filepath: docs/api/my-asyncapi.yml 241 | ``` 242 | 243 | ## Troubleshooting 244 | 245 | You can enable more log information in GitHub Action by adding `ACTIONS_STEP_DEBUG` secret to repository where you want to use this action. Set the value of this secret to `true` and you''ll notice more debug logs from this action. 246 | 247 | ## Contributors 248 | 249 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 |
Lukasz Gornicki
Lukasz Gornicki

💻 🚧 🚇 👀
Maciej Urbańczyk
Maciej Urbańczyk

👀
Victor
Victor

💻
HUTCHHUTCHHUTCH
HUTCHHUTCHHUTCH

🚇
Thomas Heyer
Thomas Heyer

🚇
Ashish Padhy
Ashish Padhy

💻 ⚠️ 📖 🤔
266 | 267 | 268 | 269 | 270 | 271 | 272 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 273 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Generator, Validator, Converter and others - all in one for your AsyncAPI docs' 2 | description: 'Use this action to generate docs or code from your AsyncAPI document. Use default templates or provide your custom ones.' 3 | inputs: 4 | cli_version: 5 | description: 'Version of AsyncAPI CLI to be used. This is only needed if you want to test with a specific version of AsyncAPI CLI. Default is latest which is also the recommended option.' 6 | required: false 7 | default: '' 8 | command: 9 | description: 'Command to run. Available commands in action :- generate, validate, convert, optimize and custom. Default is generate. For custom command, provide the whole command as input. List of available commands can be found in https://www.asyncapi.com/docs/tools/cli/usage.' 10 | required: false 11 | default: 'generate' 12 | filepath: 13 | description: 'Path to AsyncAPI document. This input is required if command is set to generate, validate, convert or optimize. Default is ./asyncapi.yaml' 14 | required: false 15 | default: 'asyncapi.yml' 16 | template: 17 | description: 'Template for the generator. Official templates are listed here https://github.com/search?q=topic%3Aasyncapi+topic%3Agenerator+topic%3Atemplate. You can pass template as npm package, url to git repository, link to tar file or local template.' 18 | default: '@asyncapi/markdown-template@0.10.0' 19 | required: false 20 | language: 21 | description: 'Language of the generated code. This input is required if you want to generate models. List of available languages can be found in https://www.asyncapi.com/docs/tools/cli/usage#asyncapi-generate-models-language-file' 22 | required: false 23 | default: '' 24 | output: 25 | description: 'Directory where to put the generated files. Can be used only with generate or convert commands. Default is output.' 26 | required: false 27 | default: 'output' 28 | parameters: 29 | description: 'The command that you use might support and even require specific parameters to be passed to the CLI for the generation. Template parameters should be preceded by -p' 30 | required: false 31 | default: '' 32 | custom_command: 33 | description: 'Custom command to be run. This input is required if command is set to custom.' 34 | required: false 35 | default: '' 36 | 37 | runs: 38 | using: 'docker' 39 | # This is the image that will be used to run the action. 40 | # IMPORTANT: The version has to be changed manually in your PRs. 41 | image: 'docker://asyncapi/github-action-for-cli:3.1.2' 42 | args: 43 | - ${{ inputs.cli_version }} 44 | - ${{ inputs.command }} 45 | - ${{ inputs.filepath }} 46 | - ${{ inputs.template }} 47 | - ${{ inputs.language }} 48 | - ${{ inputs.output }} 49 | - ${{ inputs.parameters }} 50 | - ${{ inputs.custom_command }} 51 | 52 | branding: 53 | icon: 'file-text' 54 | color: purple 55 | -------------------------------------------------------------------------------- /bump-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | version=$(cat package.json | jq -r '.version'); 4 | action=$(cat action.yml); 5 | regex='docker:\/\/asyncapi\/github-action-for-cli:([0-9.]+)' 6 | 7 | [[ $action =~ $regex ]] 8 | 9 | action_version=${BASH_REMATCH[1]}; 10 | 11 | echo "Action version: $action_version"; 12 | echo "Package version: $version"; 13 | 14 | if [[ $action_version > $version ]]; then 15 | echo "Action version is greater than package version"; 16 | else \ 17 | echo "Action version has not been bumped. Please bump the action version to the semantically correct version after $version"; \ 18 | exit 1; \ 19 | fi -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Exit immediately if a command exits with a non-zero status. 4 | # Treat unset variables as an error when substituting. 5 | set -eu 6 | 7 | NC='\033[0m' # No Color 8 | GREEN='\033[0;32m' 9 | YELLOW='\033[0;33m' 10 | BLUE='\033[0;34m' 11 | RED='\033[0;31m' 12 | 13 | if [ -z "$GITHUB_WORKSPACE" ]; then 14 | workdir=$(pwd) 15 | else 16 | workdir="$GITHUB_WORKSPACE" 17 | fi 18 | 19 | CLI_VERSION="$1" 20 | COMMAND="$2" 21 | FILEPATH="$workdir/$3" # Absolute path to the AsyncAPI file 22 | TEMPLATE="$4" 23 | LANGUAGE="$5" 24 | OUTPUT="$workdir/$6" # Absolute path to the output directory 25 | PARAMETERS="$7" 26 | CUSTOM_COMMAND="$8" 27 | 28 | echo "::group::Debug information" 29 | if [ -n "$CLI_VERSION" ] && [ ! "$CLI_VERSION" == "latest" ]; then 30 | echo -e "${BLUE}CLI version:${NC}" "$CLI_VERSION" 31 | # Check if the CLI version is already installed or not 32 | if [ -z $(command -v -- asyncapi) ]; then 33 | output='' 34 | else 35 | output=$(asyncapi --version >/dev/null 2>&1) 36 | fi 37 | # output @asyncapi/cli/1.1.1 linux-x64 node-v20.8.1 38 | version=$(echo "$output" | cut -d' ' -f1 | cut -d '/' -f3) 39 | if [ "$version" == "$CLI_VERSION" ]; then 40 | echo -e "${BLUE}AsyncAPI CLI already installed:${NC}" "$CLI_VERSION" "...skipping" 41 | else 42 | echo -e "${BLUE}Installing AsyncAPI CLI:${NC}" "$CLI_VERSION" 43 | npm install -g @asyncapi/cli@$CLI_VERSION 44 | fi 45 | else 46 | if [ -z $(command -v -- asyncapi) ]; then 47 | echo -e "${RED}No CLI installation found. Installing the latest one" 48 | npm install -g @asyncapi/cli 49 | fi 50 | echo -e "${BLUE}CLI version:${NC}" "latest" 51 | fi 52 | echo "::endgroup::" 53 | 54 | echo -e "${BLUE}AsyncAPI CLI version:${NC}" "$(asyncapi --version)" 55 | 56 | echo -e "${GREEN}Executing AsyncAPI CLI...${NC}" 57 | 58 | git config --global --add safe.directory "$GITHUB_WORKSPACE" 59 | 60 | if [ -n "$CUSTOM_COMMAND" ]; then 61 | echo "::group::Debug information" 62 | echo -e "${BLUE}Executing custom command:${NC} asyncapi" "$CUSTOM_COMMAND" 63 | eval "asyncapi $CUSTOM_COMMAND" 64 | echo "::endgroup::" 65 | exit 0 66 | fi 67 | 68 | echo "::group::Debug information" 69 | echo -e "${BLUE}Command:${NC}" "$COMMAND" 70 | echo -e "${BLUE}File:${NC}" "$FILEPATH" 71 | echo -e "${BLUE}Template:${NC}" "$TEMPLATE" 72 | echo -e "${BLUE}Language:${NC}" "$LANGUAGE" 73 | echo -e "${BLUE}Output:${NC}" "$OUTPUT" 74 | echo -e "${BLUE}Parameters:${NC}" "$PARAMETERS" 75 | echo "::endgroup::" 76 | 77 | handle_file_error () { 78 | echo -e "${RED}Validation error: File not found:${NC}" "$1" 79 | echo -e "skipping...\n" 80 | } 81 | 82 | handle_validate () { 83 | echo -e "${BLUE}Validating AsyncAPI file...${NC}" 84 | echo "::group::Debug information" 85 | 86 | if [ ! -f "$FILEPATH" ]; then 87 | handle_file_error "$FILEPATH" 88 | exit 1 89 | fi 90 | 91 | echo -e "${BLUE}Executing command:${NC}" "asyncapi validate $FILEPATH $PARAMETERS" 92 | eval "asyncapi validate $FILEPATH $PARAMETERS" 93 | echo "::endgroup::" 94 | } 95 | 96 | handle_optimize () { 97 | echo -e "${BLUE}Optimising AsyncAPI file...${NC}" 98 | echo "::group::Debug information" 99 | 100 | if [ ! -f "$FILEPATH" ]; then 101 | handle_file_error "$FILEPATH" 102 | exit 1 103 | fi 104 | 105 | echo -e "${BLUE}Executing command:${NC}" "asyncapi optimize $FILEPATH $PARAMETERS" 106 | eval "asyncapi optimize $FILEPATH $PARAMETERS" 107 | echo "::endgroup::" 108 | } 109 | 110 | handle_generate () { 111 | echo -e "${BLUE}Generating from AsyncAPI file...${NC}" 112 | 113 | if [ ! -f "$FILEPATH" ]; then 114 | handle_file_error "$FILEPATH" 115 | exit 1 116 | fi 117 | 118 | # Check if the output directory exists or not and create it if it doesn't 119 | output_dir=$(dirname "$OUTPUT") 120 | 121 | if [ ! -d "$output_dir" ]; then 122 | mkdir -p "$output_dir" 123 | echo -e "${BLUE}Created output directory:${NC}" "$output_dir" 124 | fi 125 | 126 | echo "::group::Debug information" 127 | if [ -n "$LANGUAGE" ]; then 128 | echo -e "${BLUE}Executing command:${NC}" "asyncapi generate models $LANGUAGE $FILEPATH -o $OUTPUT $PARAMETERS" 129 | eval "asyncapi generate models $LANGUAGE $FILEPATH -o $OUTPUT $PARAMETERS" 130 | elif [ -n "$TEMPLATE" ]; then 131 | echo -e "${BLUE}Executing command:${NC}" "asyncapi generate fromTemplate $FILEPATH $TEMPLATE -o $OUTPUT $PARAMETERS" 132 | eval "asyncapi generate fromTemplate $FILEPATH $TEMPLATE -o $OUTPUT $PARAMETERS" 133 | else 134 | echo -e "${RED}Invalid configuration:${NC} Either language or template must be specified." 135 | exit 1 136 | fi 137 | echo "::endgroup::" 138 | } 139 | 140 | handle_convert () { 141 | echo -e "${BLUE}Converting AsyncAPI file...${NC}" 142 | echo "::group::Debug information" 143 | 144 | if [ ! -f "$FILEPATH" ]; then 145 | handle_file_error "$FILEPATH" 146 | exit 1 147 | fi 148 | 149 | if [ -z "$OUTPUT" ]; then 150 | echo -e "${BLUE}Executing command:${NC}" "asyncapi convert $FILEPATH $PARAMETERS" 151 | eval "asyncapi convert $FILEPATH $PARAMETERS" 152 | else 153 | # Create the output directory if it doesn't exist 154 | output_dir=$(dirname "$OUTPUT") 155 | 156 | if [ ! -d "$output_dir" ]; then 157 | mkdir -p "$output_dir" 158 | echo -e "${BLUE}Created output directory:${NC}" "$output_dir" 159 | fi 160 | 161 | echo -e "${BLUE}Executing command:${NC}" "asyncapi convert $FILEPATH -o $OUTPUT $PARAMETERS" 162 | eval "asyncapi convert $FILEPATH -o $OUTPUT $PARAMETERS" 163 | fi 164 | } 165 | 166 | if [ $COMMAND == "validate" ]; then 167 | handle_validate 168 | elif [ $COMMAND == "optimize" ]; then 169 | handle_optimize 170 | elif [ $COMMAND == "generate" ]; then 171 | handle_generate 172 | elif [ $COMMAND == "convert" ]; then 173 | handle_convert 174 | else 175 | echo -e "${RED}Invalid command:${NC}" "$COMMAND" 176 | echo -e "${YELLOW}NOTE: Command can be either validate, optimize or generate.${NC}" 177 | fi -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "github-action-for-cli", 3 | "version": "3.1.2", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "github-action-for-cli", 9 | "version": "3.1.2", 10 | "license": "Apache-2.0" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "github-action-for-cli", 3 | "description": "This is to be used for running tests for the GitHub Action using the MakeFile", 4 | "version": "3.1.2", 5 | "scripts": { 6 | "test": "make test", 7 | "generate:assets": "echo 'No additional assets need to be generated at the moment'", 8 | "docker:build": "docker build -t asyncapi/github-action-for-cli:latest .", 9 | "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/asyncapi/github-action-for-cli.git" 14 | }, 15 | "keywords": [ 16 | "GitHub", 17 | "Actions", 18 | "AsyncAPI" 19 | ], 20 | "author": "Lukasz Gornicki ", 21 | "license": "Apache-2.0", 22 | "bugs": { 23 | "url": "https://github.com/asyncapi/github-action-for-cli/issues" 24 | }, 25 | "homepage": "https://github.com/asyncapi/github-action-for-cli#readme" 26 | } 27 | -------------------------------------------------------------------------------- /test/asyncapi.yml: -------------------------------------------------------------------------------- 1 | asyncapi: '2.0.0' 2 | info: 3 | title: Streetlights API 4 | version: '1.0.0' 5 | description: | 6 | The Smartylighting Streetlights API allows you 7 | to remotely manage the city lights. 8 | license: 9 | name: Apache 2.0 10 | url: 'https://www.apache.org/licenses/LICENSE-2.0' 11 | 12 | servers: 13 | mosquitto: 14 | url: mqtt://test.mosquitto.org 15 | protocol: mqtt 16 | 17 | channels: 18 | light/measured: 19 | publish: 20 | summary: Inform about environmental lighting conditions for a particular streetlight. 21 | operationId: onLightMeasured 22 | message: 23 | payload: 24 | type: object 25 | properties: 26 | id: 27 | type: integer 28 | minimum: 0 29 | description: Id of the streetlight. 30 | lumens: 31 | type: integer 32 | minimum: 0 33 | description: Light intensity measured in lumens. 34 | sentAt: 35 | type: string 36 | format: date-time 37 | description: Date and time when the message was sent. 38 | -------------------------------------------------------------------------------- /test/bundle/asyncapi.yaml: -------------------------------------------------------------------------------- 1 | asyncapi: "2.5.0" 2 | info: 3 | title: Account Service 4 | version: 1.0.0 5 | description: This service is in charge of processing user signups 6 | channels: 7 | user/signedup: 8 | subscribe: 9 | message: 10 | $ref: "messages.yaml#/messages/UserSignedUp" 11 | -------------------------------------------------------------------------------- /test/bundle/features.yaml: -------------------------------------------------------------------------------- 1 | asyncapi: "2.5.0" 2 | info: 3 | title: Account Service 4 | version: 1.0.0 5 | description: This service is in charge of processing user logouts 6 | channels: 7 | user/loggedOut: 8 | subscribe: 9 | message: 10 | $ref: "messages.yaml#/messages/UserLoggedOut" 11 | -------------------------------------------------------------------------------- /test/bundle/messages.yaml: -------------------------------------------------------------------------------- 1 | messages: 2 | UserSignedUp: 3 | payload: 4 | type: object 5 | properties: 6 | displayName: 7 | type: string 8 | description: Name of the user 9 | email: 10 | type: string 11 | format: email 12 | description: Email of the user 13 | UserLoggedOut: 14 | payload: 15 | type: object 16 | properties: 17 | displayName: 18 | type: string 19 | description: Name of the user 20 | userId: 21 | type: string 22 | description: Id the user 23 | timestamp: 24 | type: number 25 | description: Time stamp when the user logged out 26 | -------------------------------------------------------------------------------- /test/dummy.yml: -------------------------------------------------------------------------------- 1 | asyncapi: '2.3.0' 2 | 3 | externalDocs: 4 | description: Find more info here 5 | url: https://www.asyncapi.com 6 | 7 | info: 8 | title: Dummy example with all spec features included 9 | version: '0.0.1' 10 | description: | 11 | This is an example of AsyncAPI specification file that is suppose to include all possible features of the AsyncAPI specification. Do not use it on production. 12 | 13 | It's goal is to support development of documentation and code generation with the [AsyncAPI Generator](https://github.com/asyncapi/generator/) and [Template projects](https://github.com/search?q=topic%3Aasyncapi+topic%3Agenerator+topic%3Atemplate) 14 | license: 15 | name: Apache 2.0 16 | url: https://www.apache.org/licenses/LICENSE-2.0 17 | contact: 18 | name: API Support 19 | url: http://www.asyncapi.com/support 20 | email: info@asyncapi.io 21 | x-twitter: '@AsyncAPISpec' 22 | 23 | tags: 24 | - name: root-tag1 25 | externalDocs: 26 | description: External docs description 1 27 | url: https://www.asyncapi.com/ 28 | - name: root-tag2 29 | description: Description 2 30 | externalDocs: 31 | url: "https://www.asyncapi.com/" 32 | - name: root-tag3 33 | - name: root-tag4 34 | description: Description 4 35 | - name: root-tag5 36 | externalDocs: 37 | url: "https://www.asyncapi.com/" 38 | 39 | servers: 40 | dummy-mqtt: 41 | $ref: '#/components/servers/dummyMQTT' 42 | dummy-amqp: 43 | url: amqp://localhost:{port} 44 | protocol: amqp 45 | description: dummy AMQP broker 46 | protocolVersion: "0.9.1" 47 | variables: 48 | port: 49 | enum: 50 | - '15672' 51 | - '5672' 52 | security: 53 | - user-password: [] 54 | dummy-kafka: 55 | url: http://localhost:{port} 56 | protocol: kafka 57 | description: dummy Kafka broker 58 | variables: 59 | port: 60 | default: '9092' 61 | 62 | defaultContentType: application/json 63 | 64 | channels: 65 | dummy/channel/with/{dummy}/parameter/create: 66 | x-dummy-security: 67 | $ref: '#/components/securitySchemes/supportedOauthFlows/flows/clientCredentials' 68 | description: Dummy channel description. 69 | parameters: 70 | dummy: 71 | $ref: '#/components/parameters/dummy' 72 | publish: 73 | summary: Inform whenever something dummy is created. 74 | description: | 75 | Longer description. 76 | 77 | Still dummy though. 78 | operationId: receiveNewDummyInfo 79 | tags: 80 | - name: oparation-tag1 81 | externalDocs: 82 | description: External docs description 1 83 | url: https://www.asyncapi.com/ 84 | - name: oparation-tag2 85 | description: Description 2 86 | externalDocs: 87 | url: "https://www.asyncapi.com/" 88 | - name: oparation-tag3 89 | - name: oparation-tag4 90 | description: Description 4 91 | - name: oparation-tag5 92 | externalDocs: 93 | url: "https://www.asyncapi.com/" 94 | traits: 95 | - $ref: '#/components/operationTraits/kafka' 96 | message: 97 | $ref: '#/components/messages/dummyCreated' 98 | 99 | dummy/channel/without/parameter: 100 | $ref: '#/components/channels/dummyChannel' 101 | components: 102 | servers: 103 | dummyMQTT: 104 | url: mqtt://localhost 105 | protocol: mqtt 106 | description: dummy MQTT broker 107 | bindings: 108 | mqtt: 109 | clientId: guest 110 | cleanSession: true 111 | channels: 112 | dummyChannel: 113 | bindings: 114 | amqp: 115 | is: routingKey 116 | subscribe: 117 | operationId: receiveSystemInfo 118 | bindings: 119 | amqp: 120 | expiration: 100000 121 | userId: guest 122 | cc: [ 'user.logs' ] 123 | priority: 10 124 | deliveryMode: 2 125 | mandatory: false 126 | bcc: [ 'external.audit' ] 127 | replyTo: user.signedup 128 | timestamp: true 129 | ack: false 130 | bindingVersion: 0.1.0 131 | message: 132 | $ref: '#/components/messages/dummyInfo' 133 | messages: 134 | dummyCreated: 135 | name: dummyCreated 136 | title: Dummy created message 137 | summary: This is just a dummy create message 138 | correlationId: 139 | description: This is a dummy correlation ID. 140 | location: $message.header#/correlationId 141 | tags: 142 | - name: message-tag1 143 | externalDocs: 144 | description: External docs description 1 145 | url: https://www.asyncapi.com/ 146 | - name: message-tag2 147 | description: Description 2 148 | externalDocs: 149 | url: "https://www.asyncapi.com/" 150 | - name: message-tag3 151 | - name: message-tag4 152 | description: Description 4 153 | - name: message-tag5 154 | externalDocs: 155 | url: "https://www.asyncapi.com/" 156 | headers: 157 | type: object 158 | properties: 159 | my-custom-app-header: 160 | type: string 161 | correlationId: 162 | type: string 163 | payload: 164 | $ref: "#/components/schemas/dummyCreated" 165 | bindings: 166 | kafka: 167 | key: 168 | type: object 169 | properties: 170 | id: 171 | type: string 172 | format: uuid 173 | type: 174 | type: string 175 | enum: [ 'type1', "type2" ] 176 | bindingVersion: '0.1.0' 177 | amqp: 178 | contentEncoding: gzip 179 | messageType: 'user.signup' 180 | bindingVersion: 0.1.0 181 | x-response: 182 | $ref: "#/components/messages/dummyInfo" 183 | dummyInfo: 184 | name: dummyInfo 185 | title: Dummy system info 186 | summary: This is just a dummy info message 187 | correlationId: 188 | location: $message.header#/correlationId 189 | description: | 190 | More description for a dummy message. 191 | 192 | It is a dummy system info message. 193 | traits: 194 | - $ref: '#/components/messageTraits/commonHeaders' 195 | payload: 196 | $ref: "#/components/schemas/dummyInfo" 197 | examples: 198 | - name: option1example 199 | summary: this is dummy summary for option1example 200 | headers: 201 | my-app-header: 12 202 | payload: 203 | prop1: option1 204 | sentAt: 2020-01-31T13:24:53Z 205 | - name: headerExample 206 | headers: 207 | my-app-header: 13 208 | - payload: 209 | prop1: option2 210 | sentAt: 2020-01-31T13:24:53Z 211 | 212 | 213 | schemas: 214 | dummyCreated: 215 | type: object 216 | required: 217 | - prop2 218 | x-schema-extensions-as-object: 219 | type: object 220 | properties: 221 | prop1: 222 | type: string 223 | prop2: 224 | type: integer 225 | minimum: 0 226 | x-schema-extensions-as-primitive: dummy 227 | x-schema-extensions-as-array: 228 | - "item1" 229 | - "item2" 230 | properties: 231 | prop1: 232 | type: integer 233 | minimum: 0 234 | description: Dummy prop1 235 | x-prop1-dummy: dummy extension 236 | prop2: 237 | type: string 238 | description: Dummy prop2 239 | sentAt: 240 | $ref: "#/components/schemas/sentAt" 241 | dummyArrayWithObject: 242 | $ref: "#/components/schemas/dummyArrayWithObject" 243 | dummyArrayWithArray: 244 | $ref: "#/components/schemas/dummyArrayWithArray" 245 | dummyObject: 246 | $ref: "#/components/schemas/dummyObject" 247 | dummyArrayRank: 248 | $ref: '#/components/schemas/dummyArrayRank' 249 | dummyInfo: 250 | type: object 251 | required: 252 | - prop1 253 | properties: 254 | prop1: 255 | type: string 256 | enum: 257 | - option1 258 | - option2 259 | description: Dummy prop1 260 | sentAt: 261 | $ref: "#/components/schemas/sentAt" 262 | dummyArrayWithObject: 263 | type: array 264 | items: 265 | $ref: "#/components/schemas/dummyInfo" 266 | dummyArrayWithArray: 267 | type: array 268 | items: 269 | - $ref: "#/components/schemas/dummyInfo" 270 | - type: string 271 | - type: number 272 | dummyObject: 273 | type: object 274 | properties: 275 | dummyObjectProp1: 276 | $ref: "#/components/schemas/sentAt" 277 | dummyObjectProp2: 278 | $ref: "#/components/schemas/dummyRecursiveObject" 279 | dummyObjectProp3: 280 | type: object 281 | additionalProperties: true 282 | dummyObjectProp4: 283 | type: object 284 | additionalProperties: false 285 | dummyRecursiveObject: 286 | type: object 287 | properties: 288 | dummyRecursiveProp1: 289 | $ref: "#/components/schemas/dummyObject" 290 | dummyRecursiveProp2: 291 | type: string 292 | sentAt: 293 | type: string 294 | format: date-time 295 | description: Date and time when the message was sent. 296 | dummyArrayRank: 297 | type: object 298 | properties: 299 | dummyArrayValueRank: 300 | $ref: '#/components/schemas/dummyArrayValueRank' 301 | dummyArrayDimensions: 302 | $ref: '#/components/schemas/dummyArrayArrayDimensions' 303 | dummyArrayValueRank: 304 | description: > 305 | This Attribute indicates whether the val Attribute of the datapoint is an 306 | array and how many dimensions the array has. 307 | type: integer 308 | default: -1 309 | examples: 310 | - 2 311 | oneOf: 312 | - const: -1 313 | description: 'Scalar: The value is not an array.' 314 | - const: 0 315 | description: 'OneOrMoreDimensions: The value is an array with one or more dimensions.' 316 | - const: 1 317 | description: 'OneDimension: The value is an array with one dimension.' 318 | - const: 2 319 | description: 'The value is an array with two dimensions.' 320 | dummyArrayArrayDimensions: 321 | type: array 322 | items: 323 | type: integer 324 | minimum: 0 325 | examples: 326 | - [3, 5] 327 | 328 | securitySchemes: 329 | user-password: 330 | type: userPassword 331 | apiKey: 332 | type: apiKey 333 | in: user 334 | description: Provide your API key as the user and leave the password empty. 335 | supportedOauthFlows: 336 | type: oauth2 337 | description: Flows to support OAuth 2.0 338 | flows: 339 | implicit: 340 | authorizationUrl: 'https://authserver.example/auth' 341 | scopes: 342 | 'dummy:created': Ability to create dummy message 343 | 'dymmy:read': Ability to read dummy info 344 | password: 345 | tokenUrl: 'https://authserver.example/token' 346 | scopes: 347 | 'dummy:created': Ability to create dummy message 348 | 'dymmy:read': Ability to read dummy info 349 | clientCredentials: 350 | tokenUrl: 'https://authserver.example/token' 351 | scopes: 352 | 'dummy:created': Ability to create dummy message 353 | 'dymmy:read': Ability to read dummy info 354 | authorizationCode: 355 | authorizationUrl: 'https://authserver.example/auth' 356 | tokenUrl: 'https://authserver.example/token' 357 | refreshUrl: 'https://authserver.example/refresh' 358 | scopes: 359 | 'dummy:created': Ability to create dummy message 360 | 'dymmy:read': Ability to read dummy info 361 | openIdConnectWellKnown: 362 | type: openIdConnect 363 | openIdConnectUrl: 'https://authserver.example/.well-known' 364 | 365 | parameters: 366 | dummy: 367 | description: The ID of the new dummy message. 368 | schema: 369 | type: string 370 | description: Description that not be rendered, as parameter has explicit description. 371 | 372 | messageTraits: 373 | commonHeaders: 374 | headers: 375 | type: object 376 | properties: 377 | my-app-header: 378 | type: integer 379 | minimum: 0 380 | maximum: 100 381 | correlationId: 382 | type: string 383 | 384 | operationTraits: 385 | kafka: 386 | bindings: 387 | kafka: 388 | groupId: my-app-group-id 389 | clientId: my-app-client-id 390 | bindingVersion: '0.1.0' -------------------------------------------------------------------------------- /test/specification-invalid.yml: -------------------------------------------------------------------------------- 1 | asyncapi: 2.2.0 2 | info: 3 | title: Account Service 4 | version: 1.0.0 5 | description: This service is in charge of processing user signups 6 | channels: 7 | user/signedup: 8 | subscribe: 9 | message: 10 | $ref: '#/components/messages/UserSignedUp' 11 | components: 12 | messages: 13 | UserSignedUp: 14 | payload: 15 | type: object 16 | properties: 17 | displayName: 18 | type: string 19 | description: Name of the user 20 | email: 21 | type: string 22 | format: email 23 | description: Email of the user 24 | -------------------------------------------------------------------------------- /test/unoptimized.yml: -------------------------------------------------------------------------------- 1 | asyncapi: 2.0.0 2 | info: 3 | title: Streetlights API 4 | version: '1.0.0' 5 | channels: 6 | smartylighting/event/{streetlightId}/lighting/measured: 7 | parameters: 8 | #this parameter is duplicated. it can be moved to components and ref-ed from here. 9 | streetlightId: 10 | schema: 11 | type: string 12 | subscribe: 13 | operationId: receiveLightMeasurement 14 | traits: 15 | - bindings: 16 | kafka: 17 | clientId: my-app-id 18 | message: 19 | name: lightMeasured 20 | title: Light measured 21 | contentType: application/json 22 | traits: 23 | - headers: 24 | type: object 25 | properties: 26 | my-app-header: 27 | type: integer 28 | minimum: 0 29 | maximum: 100 30 | payload: 31 | type: object 32 | properties: 33 | lumens: 34 | type: integer 35 | minimum: 0 36 | #full form is used, we can ref it to: #/components/schemas/sentAt 37 | sentAt: 38 | type: string 39 | format: date-time 40 | smartylighting/action/{streetlightId}/turn/on: 41 | parameters: 42 | streetlightId: 43 | schema: 44 | type: string 45 | publish: 46 | operationId: turnOn 47 | traits: 48 | - bindings: 49 | kafka: 50 | clientId: my-app-id 51 | message: 52 | name: turnOnOff 53 | title: Turn on/off 54 | traits: 55 | - headers: 56 | type: object 57 | properties: 58 | my-app-header: 59 | type: integer 60 | minimum: 0 61 | maximum: 100 62 | payload: 63 | type: object 64 | properties: 65 | sentAt: 66 | $ref: "#/components/schemas/sentAt" 67 | components: 68 | messages: 69 | #libarary should be able to find and delete this message, because it is not used anywhere. 70 | unusedMessage: 71 | name: unusedMessage 72 | title: This message is not used in any channel. 73 | 74 | schemas: 75 | #this schema is ref-ed in one channel and used full form in another. library should be able to identify and ref the second channel as well. 76 | sentAt: 77 | type: string 78 | format: date-time --------------------------------------------------------------------------------