@asyncapi/converter 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,68 @@
|
|
|
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 && github.event.issue.state != 'closed'
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Add label
|
|
18
|
+
if: contains(github.event.comment.body, '/good-first-issue') || contains(github.event.comment.body, '/gfi' )
|
|
19
|
+
uses: actions/github-script@v5
|
|
20
|
+
with:
|
|
21
|
+
github-token: ${{ secrets.GH_TOKEN }}
|
|
22
|
+
script: |
|
|
23
|
+
const areas = ['javascript', 'typescript', 'java' , 'go', 'docs', 'ci-cd', 'design'];
|
|
24
|
+
const values = context.payload.comment.body.split(" ");
|
|
25
|
+
switch(values[1]){
|
|
26
|
+
case 'ts':
|
|
27
|
+
values[1] = 'typescript';
|
|
28
|
+
break;
|
|
29
|
+
case 'js':
|
|
30
|
+
values[1] = 'javascript';
|
|
31
|
+
case 'markdown':
|
|
32
|
+
values[1] = 'docs';
|
|
33
|
+
}
|
|
34
|
+
if(values.length != 2 || !areas.includes(values[1])){
|
|
35
|
+
const message = `Hey @${context.payload.sender.login}, something is wrong with your command please use \`/help\` for help.`
|
|
36
|
+
|
|
37
|
+
await github.rest.issues.createComment({
|
|
38
|
+
issue_number: context.issue.number,
|
|
39
|
+
owner: context.repo.owner,
|
|
40
|
+
repo: context.repo.repo,
|
|
41
|
+
body: message
|
|
42
|
+
})
|
|
43
|
+
} else {
|
|
44
|
+
|
|
45
|
+
//remove complexity and areas if there are any before adding new labels;
|
|
46
|
+
const currentLabels = (await github.rest.issues.listLabelsOnIssue({
|
|
47
|
+
issue_number: context.issue.number,
|
|
48
|
+
owner: context.repo.owner,
|
|
49
|
+
repo: context.repo.repo,
|
|
50
|
+
})).data.map(label => label.name);
|
|
51
|
+
|
|
52
|
+
const shouldBeRemoved = currentLabels.filter(label => (label.startsWith('area/') && !label.endsWith(values[1])));
|
|
53
|
+
shouldBeRemoved.forEach(label => {
|
|
54
|
+
github.rest.issues.deleteLabel({
|
|
55
|
+
owner: context.repo.owner,
|
|
56
|
+
repo: context.repo.repo,
|
|
57
|
+
name: label,
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
//add new labels
|
|
62
|
+
github.rest.issues.addLabels({
|
|
63
|
+
issue_number: context.issue.number,
|
|
64
|
+
owner: context.repo.owner,
|
|
65
|
+
repo: context.repo.repo,
|
|
66
|
+
labels: ['good first issue', `area/${values[1]}`]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -9,12 +9,11 @@ on:
|
|
|
9
9
|
- created
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
|
-
|
|
13
|
-
if: github.event.issue.pull_request
|
|
12
|
+
create_help_comment_pr:
|
|
13
|
+
if: github.event.issue.pull_request && contains(github.event.comment.body, '/help')
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
15
|
steps:
|
|
16
16
|
- uses: actions-ecosystem/action-create-comment@v1
|
|
17
|
-
if: contains(github.event.comment.body, '/help')
|
|
18
17
|
with:
|
|
19
18
|
github_token: ${{ secrets.GH_TOKEN }}
|
|
20
19
|
body: |
|
|
@@ -25,4 +24,20 @@ jobs:
|
|
|
25
24
|
At the moment the following comments are supported in pull requests:
|
|
26
25
|
|
|
27
26
|
- `/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
|
|
28
|
-
- `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
|
|
27
|
+
- `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
|
|
28
|
+
create_help_comment_issue:
|
|
29
|
+
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') }}
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions-ecosystem/action-create-comment@v1
|
|
33
|
+
with:
|
|
34
|
+
github_token: ${{ secrets.GH_TOKEN }}
|
|
35
|
+
body: |
|
|
36
|
+
Hello, @${{ github.actor }}! 👋🏼
|
|
37
|
+
|
|
38
|
+
I'm Genie from the magic lamp. Looks like somebody needs a hand! 🆘
|
|
39
|
+
|
|
40
|
+
At the moment the following comments are supported in issues:
|
|
41
|
+
|
|
42
|
+
- `/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`.
|
|
43
|
+
example: `/gfi js` or `/good-first-issue ci-cd`
|
package/cli.js
CHANGED