-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master-main' into feature/mock_implementation
# Conflicts: # lib/models/2.2.0/asyncapi.js # lib/models/2.2.0/schema.js # lib/parser.js # types.d.ts
- Loading branch information
Showing
65 changed files
with
44,247 additions
and
2,290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#This workflow is centrally managed in https://github.com/asyncapi/.github/ | ||
#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo | ||
|
||
#Purpose of this workflow is to enable anyone to label issue with 'Good First Issue' and 'area/*' with a single command. | ||
name: Add 'Good First Issue' and 'area/*' labels # if proper comment added | ||
|
||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
|
||
jobs: | ||
add-labels: | ||
if: github.event.issue && github.event.issue.state != 'closed' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Add label | ||
if: contains(github.event.comment.body, '/good-first-issue') || contains(github.event.comment.body, '/gfi' ) | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
script: | | ||
const areas = ['javascript', 'typescript', 'java' , 'go', 'docs', 'ci-cd', 'design']; | ||
const values = context.payload.comment.body.split(" "); | ||
switch(values[1]){ | ||
case 'ts': | ||
values[1] = 'typescript'; | ||
break; | ||
case 'js': | ||
values[1] = 'javascript'; | ||
case 'markdown': | ||
values[1] = 'docs'; | ||
} | ||
if(values.length != 2 || !areas.includes(values[1])){ | ||
const message = `Hey @${context.payload.sender.login}, something is wrong with your command please use \`/help\` for help.` | ||
await github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: message | ||
}) | ||
} else { | ||
//remove complexity and areas if there are any before adding new labels; | ||
const currentLabels = (await github.rest.issues.listLabelsOnIssue({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
})).data.map(label => label.name); | ||
const shouldBeRemoved = currentLabels.filter(label => (label.startsWith('area/') && !label.endsWith(values[1]))); | ||
shouldBeRemoved.forEach(label => { | ||
github.rest.issues.deleteLabel({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
name: label, | ||
}); | ||
}); | ||
//add new labels | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: ['good first issue', `area/${values[1]}`] | ||
}); | ||
} |
54 changes: 54 additions & 0 deletions
54
.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#This workflow is centrally managed in https://github.com/asyncapi/.github/ | ||
#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo | ||
|
||
#Purpose of this workflow is to enable anyone to label PR with `ready-to-merge` and `do-not-merge` labels to get stuff merged or blocked from merging | ||
name: Add ready-to-merge or do-not-merge label # if proper comment added | ||
|
||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
|
||
jobs: | ||
parse-comment-and-add-ready: # for handling cases when you want to mark as ready to merge | ||
if: github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if PR is draft # such info is not available in the context of issue_comment event | ||
uses: actions/github-script@v5 | ||
id: checkDraft | ||
with: | ||
result-encoding: string | ||
script: | | ||
const prDetailsUrl = context.payload.issue.pull_request.url; | ||
const response = await github.request(prDetailsUrl); | ||
return response.data.draft; | ||
- name: Add label | ||
if: steps.checkDraft.outputs.result == 'false' && (contains(github.event.comment.body, '/ready-to-merge') || contains(github.event.comment.body, '/rtm' )) | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
script: | | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: ['ready-to-merge'] | ||
}) | ||
parse-comment-and-add-block: # for handling cases when you want to mark as do-not-merge | ||
if: github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Add label | ||
if: contains(github.event.comment.body, '/do-not-merge') || contains(github.event.comment.body, '/dnm' ) | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
script: | | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: ['do-not-merge'] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#This workflow is centrally managed in https://github.com/asyncapi/.github/ | ||
#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo | ||
|
||
#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! | ||
name: Automerge For Humans | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- labeled | ||
- unlabeled | ||
- synchronize | ||
- opened | ||
- edited | ||
- ready_for_review | ||
- reopened | ||
- unlocked | ||
|
||
jobs: | ||
automerge-for-humans: | ||
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 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Automerge PR | ||
uses: pascalgn/automerge-action@v0.14.3 | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" | ||
MERGE_LABELS: "!do-not-merge,ready-to-merge" | ||
MERGE_METHOD: "squash" | ||
MERGE_COMMIT_MESSAGE: "pull-request-title" | ||
MERGE_RETRIES: "20" | ||
MERGE_RETRY_SLEEP: "30000" |
35 changes: 35 additions & 0 deletions
35
.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#This workflow is centrally managed in https://github.com/asyncapi/.github/ | ||
#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo | ||
|
||
# Defence from evil contributor that after adding `ready-to-merge` all suddenly makes evil commit or evil change in PR title | ||
# Label is removed once above action is detected | ||
name: Remove ready-to-merge label | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- synchronize | ||
- edited | ||
|
||
jobs: | ||
remove-ready-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Remove label | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
script: | | ||
const labelToRemove = 'ready-to-merge'; | ||
const labels = context.payload.pull_request.labels; | ||
const isLabelPresent = labels.some(label => label.name === labelToRemove) | ||
if(!isLabelPresent) return; | ||
github.rest.issues.removeLabel({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
name: labelToRemove | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#This action is centrally managed in https://github.com/asyncapi/.github/ | ||
#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo | ||
|
||
#This workflow is designed to work with: | ||
# - autoapprove and automerge workflows for dependabot and asyncapibot. | ||
# - 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 | ||
|
||
# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. | ||
#Autoupdating to latest destination branch works only in the context of upstream repo and not forks | ||
|
||
name: autoupdate | ||
|
||
on: | ||
push: {} | ||
|
||
jobs: | ||
|
||
autoupdate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Autoupdating | ||
uses: docker://chinthakagodawita/autoupdate-action:v1 | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
PR_FILTER: "labelled" | ||
PR_LABELS: "autoapproved" | ||
PR_READY_STATE: "ready_for_review" | ||
MERGE_CONFLICT_ACTION: "ignore" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.