Skip to content

Commit edaf4e1

Browse files
committed
Merge branch 'main' into feat/simplified-download
2 parents d241894 + c375408 commit edaf4e1

Some content is hidden

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

42 files changed

+479
-592
lines changed

.github/scripts/report-inactive-collaborators.mjs

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ const getDateMonthsAgo = (months = CONFIG.INACTIVE_MONTHS) => {
1515
return date.toISOString().split('T')[0];
1616
};
1717

18+
// Check if there's already an open issue
19+
async function hasOpenIssue(github, context) {
20+
const { owner, repo } = context.repo;
21+
const { data: issues } = await github.rest.issues.listForRepo({
22+
owner,
23+
repo,
24+
state: 'open',
25+
labels: CONFIG.ISSUE_LABELS[1],
26+
per_page: 1,
27+
});
28+
29+
return issues.length > 0;
30+
}
31+
1832
// Parse collaborator usernames from governance file
1933
async function parseCollaborators() {
2034
const content = await readFile(CONFIG.GOVERNANCE_FILE, 'utf8');
@@ -41,12 +55,20 @@ async function getInactiveUsers(github, usernames, repo, cutoffDate) {
4155
const inactiveUsers = [];
4256

4357
for (const username of usernames) {
44-
const { data } = await github.rest.search.commits({
58+
// Check commits
59+
const { data: commits } = await github.rest.search.commits({
4560
q: `author:${username} repo:${repo} committer-date:>=${cutoffDate}`,
4661
per_page: 1,
4762
});
4863

49-
if (data.total_count === 0) {
64+
// Check issues and PRs
65+
const { data: issues } = await github.rest.search.issuesAndPullRequests({
66+
q: `involves:${username} repo:${repo} updated:>=${cutoffDate}`,
67+
per_page: 1,
68+
});
69+
70+
// User is inactive if they have no commits AND no issues/PRs
71+
if (commits.total_count === 0 && issues.total_count === 0) {
5072
inactiveUsers.push(username);
5173
}
5274
}
@@ -75,37 +97,25 @@ ${inactiveMembers.map(m => `| @${m} |`).join('\n')}
7597
@nodejs/nodejs-website should review this list and contact inactive collaborators to confirm their continued interest in participating in the project.`;
7698
}
7799

78-
async function createOrUpdateIssue(github, context, report) {
100+
async function createIssue(github, context, report) {
79101
if (!report) return;
80102

81103
const { owner, repo } = context.repo;
82-
const { data: issues } = await github.rest.issues.listForRepo({
104+
await github.rest.issues.create({
83105
owner,
84106
repo,
85-
state: 'open',
86-
labels: CONFIG.ISSUE_LABELS[1],
87-
per_page: 1,
107+
title: CONFIG.ISSUE_TITLE,
108+
body: report,
109+
labels: CONFIG.ISSUE_LABELS,
88110
});
89-
90-
if (issues.total_count > 0) {
91-
await github.rest.issues.update({
92-
owner,
93-
repo,
94-
issue_number: issues.items[0].number,
95-
body: report,
96-
});
97-
} else {
98-
await github.rest.issues.create({
99-
owner,
100-
repo,
101-
title: CONFIG.ISSUE_TITLE,
102-
body: report,
103-
labels: CONFIG.ISSUE_LABELS,
104-
});
105-
}
106111
}
107112

108113
export default async function (github, context) {
114+
// Check for existing open issue first - exit early if one exists
115+
if (await hasOpenIssue(github, context)) {
116+
return;
117+
}
118+
109119
const cutoffDate = getDateMonthsAgo();
110120
const collaborators = await parseCollaborators();
111121

@@ -117,5 +127,5 @@ export default async function (github, context) {
117127
);
118128
const report = formatReport(inactiveMembers, cutoffDate);
119129

120-
await createOrUpdateIssue(github, context, report);
130+
await createIssue(github, context, report);
121131
}

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
# Initializes the CodeQL tools for scanning.
5252
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
53+
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
5454
with:
5555
languages: ${{ matrix.language }}
5656
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -60,7 +60,7 @@ jobs:
6060
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6161
# If this step fails, then you should remove it and run the build manually (see below)
6262
- name: Autobuild
63-
uses: github/codeql-action/autobuild@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
63+
uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
6464

6565
# ℹ️ Command-line programs to run using the OS shell.
6666
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -73,6 +73,6 @@ jobs:
7373
# ./location_of_script_within_repo/buildscript.sh
7474

7575
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
76+
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
7777
with:
7878
category: '/language:${{matrix.language}}'

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3535

3636
- name: Review Dependencies
37-
uses: actions/dependency-review-action@ce3cf9537a52e8119d91fd484ab5b8a807627bf8 # v4.6.0
37+
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1

.github/workflows/find-inactive-collaborators.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Find inactive collaborators
22

33
on:
44
schedule:
5-
# Run every Monday at 4:05 AM UTC.
6-
- cron: 5 4 * * 1
5+
- cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st day of every month
76

87
workflow_dispatch:
98

.github/workflows/lint-and-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ jobs:
147147

148148
- name: Upload test coverage to Codecov
149149
if: ${{ !cancelled() && github.event_name != 'merge_group' }}
150-
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
150+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
151151
with:
152152
files: ./apps/site/lcov.info,./packages/*/lcov.info
153153

154154
- name: Upload test results to Codecov
155155
if: ${{ !cancelled() && github.event_name != 'merge_group' }}
156-
uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0
156+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
157157
with:
158158
files: ./apps/site/junit.xml,./packages/*/junit.xml

.github/workflows/playwright-cloudflare-open-next.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535

3636
- name: Git Checkout
3737
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
with:
39+
fetch-depth: 2
3840

3941
- name: Set up pnpm
4042
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

.github/workflows/playwright.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ jobs:
6161

6262
- name: Git Checkout
6363
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
64+
with:
65+
fetch-depth: 2
6466

6567
- name: Set up pnpm
6668
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
persist-credentials: false
4343

4444
- name: Run Scorecard Analysis
45-
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
45+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
4646
with:
4747
results_file: results.sarif
4848
results_format: sarif
@@ -59,6 +59,6 @@ jobs:
5959

6060
# Upload the results to GitHub's code scanning dashboard.
6161
- name: Upload Scan Results
62-
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
62+
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
6363
with:
6464
sarif_file: results.sarif

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,14 @@ To edit an existing article, you need to find the markdown file in the `site/pag
375375

376376
The codebox component is used to display code snippets. If two code snippets follow without any text between them, they will be displayed in the same codebox, but with two tabs.
377377

378-
```md
379-
'''cjs
378+
````md
379+
```cjs
380380
const http = require('node:http');
381-
'''
381+
```
382382

383-
'''mjs
383+
```mjs
384384
import http from 'node:http';
385-
'''
386385
```
386+
````
387387

388388
`cjs` and `mjs` are variants of `js`, it's just to display the correct language in the codebox (cjs = CommonJS, mjs = ES Module).

apps/site/components/Link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const Link: FC<HTMLProps<HTMLAnchorElement>> = ({
77
href,
88
...props
99
}) => {
10-
if (!href || href.toString().startsWith('http')) {
10+
if (!href || /^https?:/.test(href.toString())) {
1111
return (
1212
<a href={href} {...props}>
1313
{children}

0 commit comments

Comments
 (0)