Skip to content

Commit 07094ee

Browse files
authored
Merge branch 'master' into punctuation
2 parents 363b1a0 + b47a2c9 commit 07094ee

26 files changed

+1260
-522
lines changed

.all-contributorsrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,19 @@
459459
"blog",
460460
"promotion"
461461
]
462+
},
463+
{
464+
"login": "Shurtu-gal",
465+
"name": "Ashish Padhy",
466+
"avatar_url": "https://avatars.githubusercontent.com/u/100484401?v=4",
467+
"profile": "http://ashishpadhy.live",
468+
"contributions": [
469+
"infra",
470+
"review",
471+
"question",
472+
"ideas",
473+
"maintenance"
474+
]
462475
}
463476
],
464477
"commitConvention": "angular",

.github/scripts/vote_tracker.js

Lines changed: 392 additions & 297 deletions
Large diffs are not rendered by default.

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

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,69 @@ on:
1818

1919
jobs:
2020
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
21+
# it runs only if PR actor is not a bot, at least not a bot that we know
22+
if: |
23+
github.event.pull_request.draft == false &&
24+
(github.event.pull_request.user.login != 'asyncapi-bot' ||
25+
github.event.pull_request.user.login != 'dependabot[bot]' ||
26+
github.event.pull_request.user.login != 'dependabot-preview[bot]')
2227
runs-on: ubuntu-latest
2328
steps:
24-
- name: Get list of authors
25-
uses: sergeysova/jq-action@v2
29+
- name: Get PR authors
2630
id: authors
31+
uses: actions/github-script@v7
2732
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
33+
script: |
34+
// Get paginated list of all commits in the PR
35+
try {
36+
const commitOpts = github.rest.pulls.listCommits.endpoint.merge({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
pull_number: context.issue.number
40+
});
41+
42+
const commits = await github.paginate(commitOpts);
43+
return commits;
44+
} catch (error) {
45+
core.setFailed(error.message);
46+
return [];
47+
}
48+
49+
- name: Create commit message
50+
id: create-commit-message
51+
uses: actions/github-script@v7
52+
with:
53+
script: |
54+
const commits = ${{ steps.authors.outputs.result }};
55+
56+
if (commits.length === 0) {
57+
core.setFailed('No commits found in the PR');
58+
return '';
59+
}
60+
61+
// Get unique authors from the commits list
62+
const authors = commits.reduce((acc, commit) => {
63+
const username = commit.author?.login || commit.commit.author?.name;
64+
if (username && !acc[username]) {
65+
acc[username] = {
66+
name: commit.commit.author?.name,
67+
email: commit.commit.author?.email,
68+
}
69+
}
70+
71+
return acc;
72+
}, {});
73+
74+
// Create a string of the form "Co-authored-by: Name <email>"
75+
// ref: https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors
76+
const coAuthors = Object.values(authors).map(author => {
77+
return `Co-authored-by: ${author.name} <${author.email}>`;
78+
}).join('\n');
79+
80+
core.debug(coAuthors);;
81+
82+
return coAuthors;
83+
4584
- name: Automerge PR
4685
uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6
4786
env:
@@ -50,6 +89,6 @@ jobs:
5089
MERGE_METHOD: "squash"
5190
# Using the output of the previous step (`Co-authored-by: ...` lines) as commit description.
5291
# 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 }}"
92+
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})\n\n\n${{ fromJSON(steps.create-commit-message.outputs.result) }}"
5493
MERGE_RETRIES: "20"
5594
MERGE_RETRY_SLEEP: "30000"

.github/workflows/help-command.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ jobs:
5858
At the moment the following comments are supported in issues:
5959

6060
- \`/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\``
61+
example: \`/gfi js\` or \`/good-first-issue ci-cd\`
62+
- \`/transfer-issue {repo-name}\` or \`/ti {repo-name}\` - transfer issue from the source repository to the other repository passed by the user. example: \`/ti cli\` or \`/transfer-issue cli\`.`
6263
})

.github/workflows/maintainer_management.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
name: Maintainer Management Workflow
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [closed]
66
paths:
77
- 'MAINTAINERS.yaml'
8-
env:
9-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
108

119
jobs:
1210
detect_maintainer_changes:
@@ -75,11 +73,11 @@ jobs:
7573
7674
- name: Debug newMaintainers output
7775
run: |
78-
echo "newMaintainers = $newMaintainers"
76+
echo "newMaintainers = ${{ steps.compare-files.outputs.newMaintainers }}"
7977
8078
- name: Debug removedMaintainers output
8179
run: |
82-
echo "removedMaintainers = $removedMaintainers"
80+
echo "removedMaintainers = ${{ steps.compare-files.outputs.removedMaintainers }}"
8381
8482
outputs:
8583
newMaintainers: ${{ steps.compare-files.outputs.newMaintainers }}
@@ -94,7 +92,7 @@ jobs:
9492
- name: Invite new maintainers to the organization
9593
uses: actions/github-script@v6
9694
with:
97-
github-token: ${{ env.GH_TOKEN }}
95+
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
9896
script: |
9997
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
10098
for (const maintainer of newMaintainers) {
@@ -111,7 +109,7 @@ jobs:
111109
- name: Add new maintainers to the team
112110
uses: actions/github-script@v6
113111
with:
114-
github-token: ${{ env.GH_TOKEN }}
112+
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
115113
script: |
116114
const newMaintainers = '${{ needs.detect_maintainer_changes.outputs.newMaintainers }}'.split(',');
117115
for (const maintainer of newMaintainers) {
@@ -137,15 +135,15 @@ jobs:
137135
- name: Display welcome message for new maintainers
138136
uses: actions/github-script@v6
139137
with:
140-
github-token: ${{ secrets.GH_TOKEN }}
138+
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
141139
script: |
142140
const newMaintainers = "${{ needs.add_maintainer.outputs.newMaintainers }}".split(",");
143141
console.log(`New maintainers: ${newMaintainers}`);
144142
const welcomeMessage = newMaintainers.map((maintainer) => `@${maintainer.trim().replace(/^@/, '')} I have invited you to join the AsyncAPI organization, and you are added to the team that lists all Maintainers.\n
145143
146144
Please take a moment to verify if you would like to provide more details for your account, such as your LinkedIn profile, Twitter handle, or company affiliation. In case there is anything you want to add, please open up a separate pull request for the \`MAINTAINERS.yaml\` file.\n
147145
148-
Additionally, if you are interested in becoming a [TSC member](https://github.com/amadeus4dev-examples/amadeus-async-flight-status) and contributing to the direction of the AsyncAPI Initiative, let us know, and we'll be happy to guide you through the process. Every maintainer has the right to become a TSC member, just open a pull request to modify your entry in \`MAINTAINER.yaml\` file and make sure \`isTscMember\` property is set to \`true\`. You can find some basic information about TSC membership in [this TSC-related guide](https://github.com/asyncapi/community/blob/master/TSC_MEMBERSHIP.md). Feel free to reach out to us for more help by dropping a comment in this pull request, or by asking for help in our Slack.\n
146+
Additionally, if you are interested in becoming a [TSC member](https://www.youtube.com/watch?v=MfVUUbW2aos) and contributing to the direction of the AsyncAPI Initiative, let us know, and we'll be happy to guide you through the process. Every maintainer has the right to become a TSC member, just open a pull request to modify your entry in \`MAINTAINER.yaml\` file and make sure \`isTscMember\` property is set to \`true\`. You can find some basic information about TSC membership in [this TSC-related guide](https://github.com/asyncapi/community/blob/master/TSC_MEMBERSHIP.md). Feel free to reach out to us for more help by dropping a comment in this pull request, or by asking for help in our Slack.\n
149147
150148
Welcome aboard! We are excited to have you as part of the team.`).join("\n");
151149
@@ -161,12 +159,13 @@ jobs:
161159
- name: Remove maintainers from the organization
162160
uses: actions/github-script@v6
163161
with:
164-
github-token: ${{ env.GH_TOKEN }}
162+
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
165163
script: |
166164
const removedMaintainers = '${{ needs.detect_maintainer_changes.outputs.removedMaintainers }}'.split(',');
167165
for (const maintainer of removedMaintainers) {
168166
try {
169-
await github.request('DELETE /orgs/asyncapi/memberships/{username}', {
167+
await github.request('DELETE /orgs/{org}/memberships/{username}', {
168+
org: 'asyncapi',
170169
username: maintainer
171170
});
172171
core.info(`Successfully removed ${maintainer} from the organization.`);
@@ -187,7 +186,7 @@ jobs:
187186
- name: Display goodbye message to removed maintainers
188187
uses: actions/github-script@v6
189188
with:
190-
github-token: ${{ env.GH_TOKEN }}
189+
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
191190
script: |
192191
const removedMaintainers = "${{ needs.remove_maintainer.outputs.removedMaintainers }}".split(",");
193192
const removedTscMembers = "${{ needs.remove_maintainer.outputs.removedTscMembers }}".split(",");
@@ -218,7 +217,6 @@ jobs:
218217
- name: Add TSC members to Emeritus.yaml and print
219218
uses: actions/github-script@v6
220219
with:
221-
github-token: ${{ env.GH_TOKEN }}
222220
script: |
223221
const fs = require('fs');
224222
const path = './Emeritus.yaml';
@@ -249,8 +247,9 @@ jobs:
249247
- name: Commit and push
250248
run: |
251249
git add .
252-
git commit -m "Update Emeritus.yaml"
253-
git push https://${{ secrets.GH_TOKEN}}@github.com/asyncapi/community update-emeritus-${{ github.run_id }}
250+
git commit -m "chore: update Emeritus.yaml"
251+
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/asyncapi/community.git
252+
git push origin update-emeritus-${{ github.run_id }}
254253
255254
- name: Create PR
256255
run: |
@@ -267,4 +266,4 @@ jobs:
267266
SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}}
268267
SLACK_TITLE: 🚨 Maintainer Management Workflow failed 🚨
269268
SLACK_MESSAGE: Failed to post a message to new Maintainer
270-
MSG_MINIMAL: true
269+
MSG_MINIMAL: true

.github/workflows/maintainers-tsc-changes-verification.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
name: Verify tsc and maintainers changes by human and bot
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [synchronize, opened, reopened]
66
paths:
77
- "MAINTAINERS.yaml"
8-
env:
9-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
108

119
jobs:
1210
verify-changes-if-tsc-if-maintainers:
@@ -35,7 +33,7 @@ jobs:
3533
id: verify-changes
3634
uses: actions/github-script@v6
3735
with:
38-
github-token: ${{ env.GITHUB_TOKEN }}
36+
github-token: ${{ secrets.GH_TOKEN }}
3937
script: |
4038
const yaml = require("js-yaml");
4139
const fs = require("fs");
@@ -125,7 +123,7 @@ jobs:
125123
- name: Comment and close the PR if there are any critical changes done by human
126124
uses: actions/github-script@v6
127125
with:
128-
github-token: ${{ env.GITHUB_TOKEN }}
126+
github-token: ${{ secrets.GH_TOKEN }}
129127
script: |
130128
const errorMessagesString = `${{ needs.verify-changes-if-tsc-if-maintainers.outputs.errorMessages }}`;
131129
const errorMessages = errorMessagesString ? JSON.parse(errorMessagesString) : [];
@@ -161,7 +159,7 @@ jobs:
161159
if: steps.verify-changes-if-tsc-if-maintainers.outputs.removedTscMembers != ''
162160
uses: actions/github-script@v6
163161
with:
164-
github-token: ${{ env.GITHUB_TOKEN }}
162+
github-token: ${{ secrets.GH_TOKEN }}
165163
script: |
166164
const issueComment = {
167165
owner: github.context.repo.owner,

.github/workflows/transfer-issue.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: Transfer Issues between repositories
5+
6+
on:
7+
issue_comment:
8+
types:
9+
- created
10+
11+
jobs:
12+
transfer:
13+
if: ${{(!github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot') && (startsWith(github.event.comment.body, '/transfer-issue') || startsWith(github.event.comment.body, '/ti'))}}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
- name: Extract Input
19+
id: extract_step
20+
run: |
21+
COMMENT="${{github.event.comment.body}}"
22+
REPO=$(echo $COMMENT | awk '{print $2}')
23+
echo repo=$REPO >> $GITHUB_OUTPUT
24+
- name: Check Repo
25+
uses: actions/github-script@v7
26+
with:
27+
github-token: ${{secrets.GH_TOKEN}}
28+
script: |
29+
const r = "${{github.repository}}"
30+
const [owner, repo] = r.split('/')
31+
const repoToMove = process.env.REPO_TO_MOVE
32+
const issue_number = context.issue.number
33+
try {
34+
const {data} = await github.rest.repos.get({
35+
owner,
36+
repo: repoToMove
37+
})
38+
}catch (e) {
39+
const body = `${repoToMove} is not a repo under ${owner}. You can only transfer issue to repos that belong to the same organization.`
40+
await github.rest.issues.createComment({
41+
owner,
42+
repo,
43+
issue_number,
44+
body
45+
})
46+
process.exit(1)
47+
}
48+
env:
49+
REPO_TO_MOVE: ${{steps.extract_step.outputs.repo}}
50+
- name: Transfer Issue
51+
id: transferIssue
52+
working-directory: ./
53+
run: |
54+
gh issue transfer ${{github.event.issue.number}} asyncapi/${{steps.extract_step.outputs.repo}}
55+
env:
56+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
57+

0 commit comments

Comments
 (0)