Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 50db191

Browse files
authored
Merge branch 'master' into master
2 parents 559ba31 + 57d2e23 commit 50db191

17 files changed

+1627
-303
lines changed

.github/workflows/add-good-first-issue-labels.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
break;
2929
case 'js':
3030
values[1] = 'javascript';
31+
break;
3132
case 'markdown':
3233
values[1] = 'docs';
34+
break;
3335
}
3436
if(values.length != 2 || !areas.includes(values[1])){
3537
const message = `Hey @${context.payload.sender.login}, your message doesn't follow the requirements, you can try \`/help\`.`

.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
name: Label PRs # if proper comment added
99

10-
on:
11-
issue_comment:
12-
types:
13-
- created
10+
on:
11+
issue_comment:
12+
types:
13+
- created
1414

1515
jobs:
1616
add-ready-to-merge-label:
17-
if: >
17+
if: >
1818
github.event.issue.pull_request &&
1919
github.event.issue.state != 'closed' &&
2020
github.actor != 'asyncapi-bot' &&
@@ -25,7 +25,6 @@ jobs:
2525
2626
runs-on: ubuntu-latest
2727
steps:
28-
2928
- name: Add ready-to-merge label
3029
uses: actions/github-script@v5
3130
with:
@@ -64,7 +63,7 @@ jobs:
6463
Thanks 😄`
6564
})
6665
}
67-
66+
6867
add-do-not-merge-label:
6968
if: >
7069
github.event.issue.pull_request &&
@@ -86,7 +85,7 @@ jobs:
8685
owner: context.repo.owner,
8786
repo: context.repo.repo,
8887
labels: ['do-not-merge']
89-
})
88+
})
9089
add-autoupdate-label:
9190
if: >
9291
github.event.issue.pull_request &&
@@ -108,4 +107,4 @@ jobs:
108107
owner: context.repo.owner,
109108
repo: context.repo.repo,
110109
labels: ['autoupdate']
111-
})
110+
})

.github/workflows/automerge-for-humans-merging.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,35 @@ jobs:
2121
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
2222
runs-on: ubuntu-latest
2323
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
2445
- name: Automerge PR
2546
uses: pascalgn/automerge-action@v0.14.3
2647
env:
2748
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
2849
MERGE_LABELS: "!do-not-merge,ready-to-merge"
2950
MERGE_METHOD: "squash"
30-
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
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 }}"
3154
MERGE_RETRIES: "20"
32-
MERGE_RETRY_SLEEP: "30000"
55+
MERGE_RETRY_SLEEP: "30000"

.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@ jobs:
2222
script: |
2323
const labelToRemove = 'ready-to-merge';
2424
const labels = context.payload.pull_request.labels;
25-
2625
const isLabelPresent = labels.some(label => label.name === labelToRemove)
27-
2826
if(!isLabelPresent) return;
29-
3027
github.rest.issues.removeLabel({
3128
issue_number: context.issue.number,
3229
owner: context.repo.owner,
3330
repo: context.repo.repo,
3431
name: labelToRemove
35-
})
32+
})

.github/workflows/if-go-pr-testing.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/if-nodejs-release.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ on:
99
branches:
1010
- master
1111
# below lines are not enough to have release supported for these branches
12-
# make sure configuration of `semantic-release` package mentiones these branches
13-
- next
12+
# make sure configuration of `semantic-release` package mentions these branches
13+
- next-spec
1414
- next-major
15+
- next-major-spec
1516
- beta
1617
- alpha
17-
- '**-release' # custom
1818

1919
jobs:
2020

@@ -48,6 +48,15 @@ jobs:
4848
- if: steps.packagejson.outputs.exists == 'true'
4949
name: Run test
5050
run: npm test
51+
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
52+
name: Report workflow run status to Slack
53+
uses: 8398a7/action-slack@v3
54+
with:
55+
status: ${{ job.status }}
56+
fields: repo,action,workflow
57+
text: 'Release workflow failed in testing job'
58+
env:
59+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
5160

5261
release:
5362
needs: [test-nodejs]
@@ -84,3 +93,12 @@ jobs:
8493
GIT_COMMITTER_NAME: asyncapi-bot
8594
GIT_COMMITTER_EMAIL: info@asyncapi.io
8695
run: npm run release
96+
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
97+
name: Report workflow run status to Slack
98+
uses: 8398a7/action-slack@v3
99+
with:
100+
status: ${{ job.status }}
101+
fields: repo,action,workflow
102+
text: 'Release workflow failed in release job'
103+
env:
104+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

.github/workflows/issues-prs-notifications.yml

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
name: Notify slack
66

77
on:
8-
98
issues:
109
types: [opened, reopened]
1110

@@ -16,57 +15,56 @@ on:
1615
types: [created]
1716

1817
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: LoveToKnow/slackify-markdown-action@v1.0.0
25+
id: issuemarkdown
26+
with:
27+
text: "[${{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
1935

20-
issue:
21-
if: github.event_name == 'issues' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
22-
name: Notify slack on every new issue
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: Convert markdown to slack markdown for issue
26-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
27-
id: issuemarkdown
28-
with:
29-
text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
30-
- name: Send info about issue
31-
uses: rtCamp/action-slack-notify@v2
32-
env:
33-
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
34-
SLACK_TITLE: 🐛 New Issue in ${{github.repository}} 🐛
35-
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
36-
MSG_MINIMAL: true
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: LoveToKnow/slackify-markdown-action@v1.0.0
43+
id: prmarkdown
44+
with:
45+
text: "[${{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
3753

38-
pull_request:
39-
if: github.event_name == 'pull_request_target' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
40-
name: Notify slack on every new pull request
41-
runs-on: ubuntu-latest
42-
steps:
43-
- name: Convert markdown to slack markdown for pull request
44-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
45-
id: prmarkdown
46-
with:
47-
text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
48-
- name: Send info about pull request
49-
uses: rtCamp/action-slack-notify@v2
50-
env:
51-
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
52-
SLACK_TITLE: 💪 New Pull Request in ${{github.repository}} 💪
53-
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
54-
MSG_MINIMAL: true
55-
56-
discussion:
57-
if: github.event_name == 'discussion' && github.actor != 'asyncapi-bot' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
58-
name: Notify slack on every new pull request
59-
runs-on: ubuntu-latest
60-
steps:
61-
- name: Convert markdown to slack markdown for pull request
62-
uses: LoveToKnow/slackify-markdown-action@v1.0.0
63-
id: discussionmarkdown
64-
with:
65-
text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
66-
- name: Send info about pull request
67-
uses: rtCamp/action-slack-notify@v2
68-
env:
69-
SLACK_WEBHOOK: ${{secrets.SLACK_GITHUB_NEWISSUEPR}}
70-
SLACK_TITLE: 💬 New Discussion in ${{github.repository}} 💬
71-
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
72-
MSG_MINIMAL: true
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: LoveToKnow/slackify-markdown-action@v1.0.0
61+
id: discussionmarkdown
62+
with:
63+
text: "[${{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

0 commit comments

Comments
 (0)