Skip to content

Commit 84f8879

Browse files
authored
Merge branch 'master' into yhyh
2 parents 9eff23f + c262eca commit 84f8879

98 files changed

Lines changed: 2489 additions & 2327 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": "next/core-web-vitals",
3+
"rules": {
4+
"@next/next/no-html-link-for-pages": ["error", "app"]
5+
}
36
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ on:
99
types:
1010
- created
1111

12+
permissions: {}
13+
1214
jobs:
1315
add-labels:
16+
name: Add 'Good First Issue' and 'area/*' labels
1417
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' ))}}
1518
runs-on: ubuntu-latest
19+
permissions:
20+
issues: write # This is needed to add labels to issues.
1621
steps:
1722
- name: Add label
1823
uses: actions/github-script@v7
1924
with:
20-
github-token: ${{ secrets.GH_TOKEN }}
25+
github-token: ${{ github.token }}
2126
script: |
2227
const areas = ['javascript', 'typescript', 'java' , 'go', 'docs', 'ci-cd', 'design'];
2328
const words = context.payload.comment.body.trim().split(" ");

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ on:
1212
types:
1313
- created
1414

15+
permissions: {}
16+
1517
jobs:
1618
add-ready-to-merge-label:
19+
name: Add ready-to-merge label
20+
permissions:
21+
issues: write # required to add labels and post comments on PR issues
22+
pull-requests: write # required to read PR metadata from the issue pull_request URL
23+
contents: read # required to compare PR branch commits against base
1724
if: >
1825
github.event.issue.pull_request &&
1926
github.event.issue.state != 'closed' &&
@@ -30,6 +37,9 @@ jobs:
3037
env:
3138
GITHUB_ACTOR: ${{ github.actor }}
3239
with:
40+
# Use bot PAT, not the default GITHUB_TOKEN: events created by
41+
# GITHUB_TOKEN do not trigger other workflows, so `Automerge For
42+
# Humans` would never see the `labeled` event.
3343
github-token: ${{ secrets.GH_TOKEN }}
3444
script: |
3545
const prDetailsUrl = context.payload.issue.pull_request.url;
@@ -69,6 +79,10 @@ jobs:
6979
}
7080
7181
add-do-not-merge-label:
82+
name: Add do-not-merge label
83+
permissions:
84+
issues: write # required to add labels on PR issues
85+
pull-requests: write # required to read PR metadata from the issue pull_request URL
7286
if: >
7387
github.event.issue.pull_request &&
7488
github.event.issue.state != 'closed' &&
@@ -82,6 +96,7 @@ jobs:
8296
- name: Add do-not-merge label
8397
uses: actions/github-script@v7
8498
with:
99+
# Bot PAT so the `labeled` event can trigger downstream workflows.
85100
github-token: ${{ secrets.GH_TOKEN }}
86101
script: |
87102
github.rest.issues.addLabels({
@@ -91,6 +106,10 @@ jobs:
91106
labels: ['do-not-merge']
92107
})
93108
add-autoupdate-label:
109+
name: Add autoupdate label
110+
permissions:
111+
issues: write # required to add labels on PR issues
112+
pull-requests: write # required to read PR metadata from the issue pull_request URL
94113
if: >
95114
github.event.issue.pull_request &&
96115
github.event.issue.state != 'closed' &&
@@ -104,6 +123,7 @@ jobs:
104123
- name: Add autoupdate label
105124
uses: actions/github-script@v7
106125
with:
126+
# Bot PAT so the `labeled` event can trigger the autoupdate workflow.
107127
github-token: ${{ secrets.GH_TOKEN }}
108128
script: |
109129
github.rest.issues.addLabels({

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,20 @@ on:
1414
- edited
1515
- ready_for_review
1616
- reopened
17-
- unlocked
17+
- unlocked # zizmor: ignore[dangerous-triggers] needed if we want author to be our bot
18+
19+
permissions: {}
1820

1921
jobs:
2022
automerge-for-humans:
23+
name: Automerge PRs labeled with ready-to-merge
24+
permissions:
25+
contents: read # required for PR commit metadata reads
26+
pull-requests: read # required to read pull request details in github-script steps
2127
# it runs only if PR actor is not a bot, at least not a bot that we know
2228
if: |
2329
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]')
30+
!contains(fromJSON('["asyncapi-bot","dependabot[bot]","dependabot-preview[bot]"]'), github.event.pull_request.user.login)
2731
runs-on: ubuntu-latest
2832
steps:
2933
- name: Get PR authors
@@ -68,9 +72,11 @@ jobs:
6872
- name: Create commit message
6973
id: create-commit-message
7074
uses: actions/github-script@v7
75+
env:
76+
AUTHORS_JSON: ${{ steps.authors.outputs.result }}
7177
with:
7278
script: |
73-
const authors = ${{ steps.authors.outputs.result }};
79+
const authors = JSON.parse(process.env.AUTHORS_JSON);
7480
7581
if (Object.keys(authors).length === 0) {
7682
core.setFailed('No authors found in the PR');

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@
66
name: Remove ready-to-merge label
77

88
on:
9-
pull_request_target:
9+
pull_request:
1010
types:
1111
- synchronize
1212
- edited
1313

14+
permissions: {}
15+
1416
jobs:
1517
remove-ready-label:
18+
name: Remove ready-to-merge label
1619
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: write # required to remove labels and post comments on PR issues
1722
steps:
1823
- name: Remove label
1924
uses: actions/github-script@v7
2025
with:
21-
github-token: ${{ secrets.GH_TOKEN }}
26+
github-token: ${{ github.token }}
2227
script: |
2328
const labelToRemove = 'ready-to-merge';
2429
const labels = context.payload.pull_request.labels;

.github/workflows/automerge-orphans.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,26 @@ on:
77
schedule:
88
- cron: "0 0 * * *"
99

10+
permissions: {}
11+
1012
jobs:
1113
identify-orphans:
1214
if: startsWith(github.repository, 'asyncapi/')
1315
name: Find orphans and notify
16+
permissions:
17+
contents: read # required by checkout and repository metadata reads
18+
pull-requests: read # required to list open pull requests
1419
runs-on: ubuntu-latest
1520
steps:
1621
- name: Checkout repository
1722
uses: actions/checkout@v4
23+
with:
24+
persist-credentials: false
1825
- name: Get list of orphans
1926
uses: actions/github-script@v7
2027
id: orphans
2128
with:
22-
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
github-token: ${{ github.token }}
2330
script: |
2431
const query = `query($owner:String!, $name:String!) {
2532
repository(owner:$owner, name:$name){

.github/workflows/automerge.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
name: Automerge PRs from bots
55

66
on:
7-
pull_request_target:
7+
pull_request_target: # Needed as GH_TOKEN_BOT_EVE needed for approval.
88
types:
99
- opened
10-
- synchronize
10+
- synchronize # zizmor: ignore[dangerous-triggers]
11+
12+
permissions: {}
1113

1214
jobs:
1315
autoapprove-for-bot:

.github/workflows/autoupdate.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ on:
1818
- 'bot/**'
1919
- 'all-contributors/**'
2020

21+
permissions: {}
22+
2123
jobs:
2224
autoupdate-for-bot:
2325
if: startsWith(github.repository, 'asyncapi/')
2426
name: Autoupdate autoapproved PR created in the upstream
2527
runs-on: ubuntu-latest
2628
steps:
2729
- name: Autoupdating
28-
uses: docker://chinthakagodawita/autoupdate-action:v1
30+
uses: chinthakagodawita/autoupdate@0707656cd062a3b0cf8fa9b2cda1d1404d74437e
2931
env:
3032
GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}'
3133
PR_FILTER: "labelled"

.github/workflows/bounty-program-commands.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ env:
2020
{"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"}
2121
]
2222
23+
permissions: {}
24+
2325
jobs:
2426
guard-against-unauthorized-use:
27+
name: Guard against unauthorized use
28+
permissions:
29+
issues: write # required to post a comment on the issue/PR
30+
pull-requests: write # required to post a comment on the issue/PR if it's a PR
2531
if: >
26-
github.actor != ('aeworxet' || 'thulieblack') &&
32+
!contains(fromJSON('["aeworxet","thulieblack"]'), github.actor) &&
2733
(
2834
startsWith(github.event.comment.body, '/bounty' )
2935
)
@@ -36,7 +42,7 @@ jobs:
3642
env:
3743
ACTOR: ${{ github.actor }}
3844
with:
39-
github-token: ${{ secrets.GH_TOKEN }}
45+
github-token: ${{ github.token }}
4046
script: |
4147
const commentText = `❌ @${process.env.ACTOR} is not authorized to use the Bounty Program's commands.
4248
These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`;
@@ -50,19 +56,22 @@ jobs:
5056
})
5157
5258
add-label-bounty:
59+
name: Add bounty label
60+
permissions:
61+
issues: write # required to read/create labels and add labels on the issue/PR
62+
pull-requests: write # required to read/create labels and add labels on the issue/PR
5363
if: >
54-
github.actor == ('aeworxet' || 'thulieblack') &&
64+
contains(fromJSON('["aeworxet","thulieblack"]'), github.actor) &&
5565
(
5666
startsWith(github.event.comment.body, '/bounty' )
5767
)
5868
5969
runs-on: ubuntu-latest
60-
6170
steps:
6271
- name: Add label `bounty`
6372
uses: actions/github-script@v7
6473
with:
65-
github-token: ${{ secrets.GH_TOKEN }}
74+
github-token: ${{ github.token }}
6675
script: |
6776
const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON);
6877
let LIST_OF_LABELS_FOR_REPO = await github.rest.issues.listLabelsForRepo({
@@ -91,19 +100,21 @@ jobs:
91100
})
92101
93102
remove-label-bounty:
103+
name: Remove bounty label
104+
permissions:
105+
issues: write # required to read/remove labels on the issue/PR
106+
pull-requests: write # required to read/remove labels on the issue/PR if it's a PR
94107
if: >
95-
github.actor == ('aeworxet' || 'thulieblack') &&
108+
contains(fromJSON('["aeworxet","thulieblack"]'), github.actor) &&
96109
(
97110
startsWith(github.event.comment.body, '/unbounty' )
98111
)
99-
100112
runs-on: ubuntu-latest
101-
102113
steps:
103114
- name: Remove label `bounty`
104115
uses: actions/github-script@v7
105116
with:
106-
github-token: ${{ secrets.GH_TOKEN }}
117+
github-token: ${{ github.token }}
107118
script: |
108119
const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON);
109120
let LIST_OF_LABELS_FOR_ISSUE = await github.rest.issues.listLabelsOnIssue({

.github/workflows/help-command.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@
44
name: Create help comment
55

66
on:
7-
issue_comment:
8-
types:
9-
- created
7+
issue_comment:
8+
types:
9+
- created
10+
11+
permissions: {}
1012

1113
jobs:
1214
create_help_comment_pr:
15+
name: Help Comment in PR
1316
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }}
1417
runs-on: ubuntu-latest
18+
permissions:
19+
pull-requests: write # To comment on Pull requests
1520
steps:
1621
- name: Add comment to PR
1722
uses: actions/github-script@v7
1823
env:
1924
ACTOR: ${{ github.actor }}
2025
with:
21-
github-token: ${{ secrets.GH_TOKEN }}
26+
github-token: ${{ github.token }}
2227
script: |
2328
//Yes to add comment to PR the same endpoint is use that we use to create a comment in issue
2429
//For more details http://developer.github.com/v3/issues/comments/
@@ -41,15 +46,18 @@ jobs:
4146
})
4247

4348
create_help_comment_issue:
49+
name: Help Comment in Issue
4450
if: ${{ !github.event.issue.pull_request && startsWith(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }}
4551
runs-on: ubuntu-latest
52+
permissions:
53+
issues: write # To comment on Issues
4654
steps:
4755
- name: Add comment to Issue
4856
uses: actions/github-script@v7
4957
env:
5058
ACTOR: ${{ github.actor }}
5159
with:
52-
github-token: ${{ secrets.GH_TOKEN }}
60+
github-token: ${{ github.token }}
5361
script: |
5462
github.rest.issues.createComment({
5563
issue_number: context.issue.number,

0 commit comments

Comments
 (0)