Skip to content

Commit 6ec36f4

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into resolve-parent-paths-by
2 parents 3910ca8 + 2d0ea39 commit 6ec36f4

File tree

2,227 files changed

+181750
-8963
lines changed

Some content is hidden

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

2,227 files changed

+181750
-8963
lines changed

.github/workflows/check_licenses.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
# Install Node.js:
8282
- name: 'Install Node.js'
8383
# Pin action to full length commit SHA
84-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
84+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
8585
with:
8686
node-version: '20' # 'lts/*'
8787
timeout-minutes: 5
@@ -128,7 +128,7 @@ jobs:
128128
# Upload the log file:
129129
- name: 'Upload log file'
130130
# Pin action to full length commit SHA
131-
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
131+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
132132
if: always()
133133
with:
134134
# Define a name for the uploaded artifact:
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2024 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: cleanup_coverage
21+
22+
# Workflow triggers:
23+
on:
24+
25+
# Trigger the workflow when a pull request is closed (e.g., merged or closed without merging):
26+
pull_request_target:
27+
types:
28+
- closed
29+
30+
# Workflow jobs:
31+
jobs:
32+
33+
# Define a job to perform coverage cleanup...
34+
cleanup:
35+
36+
# Define a display name:
37+
name: 'Cleanup coverage'
38+
39+
# Define the type of virtual host machine:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
# Delete the 'pr-<number>' branch from the 'stdlib-js/www-test-code-coverage' repository:
44+
- name: 'Delete coverage branch for PR'
45+
env:
46+
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
47+
PR_NUMBER: ${{ github.event.pull_request.number }}
48+
run: |
49+
curl -X DELETE -H "Authorization: token $REPO_GITHUB_TOKEN" \
50+
"https://api.github.com/repos/stdlib-js/www-test-code-coverage/git/refs/heads/pr-${PR_NUMBER}" \
51+
|| echo "Branch pr-${PR_NUMBER} does not exist or could not be deleted."
52+
53+
# Find and update the '## Coverage Report' comment in the PR
54+
- name: 'Update coverage comment in PR'
55+
# Pin action to full length commit SHA
56+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
57+
with:
58+
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
59+
script: |
60+
const prNumber = context.payload.pull_request.number;
61+
const { data: comments } = await github.rest.issues.listComments({
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
issue_number: prNumber,
65+
});
66+
const coverageComment = comments.find( comment => comment.body && comment.body.includes( '## Coverage Report' ) );
67+
if ( coverageComment ) {
68+
// Replace URLs with plain text in the coverage report comment body:
69+
const updatedBody = coverageComment.body.replace( /<a href="[^"]+">([^<]+)<\/a>/g, '$1' );
70+
await github.rest.issues.updateComment({
71+
owner: context.repo.owner,
72+
repo: context.repo.repo,
73+
comment_id: coverageComment.id,
74+
body: updatedBody,
75+
});
76+
} else {
77+
console.log( 'No Coverage Report comment found.' );
78+
}

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
# Install Node.js:
122122
- name: 'Install Node.js'
123123
# Pin action to full length commit SHA
124-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
124+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
125125
with:
126126
node-version: '20' # 'lts/*'
127127
timeout-minutes: 5

.github/workflows/generate_pr_commit_message.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
7777
# Post commit message as PR comment:
7878
- name: 'Post commit message as PR comment'
79-
uses: peter-evans/create-or-update-comment@v3
79+
uses: peter-evans/create-or-update-comment@v4
8080
with:
8181
token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
8282
issue-number: ${{ github.event.pull_request.number }}

.github/workflows/lint_autofix.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,26 @@ on:
2525
# Allow the workflow to be triggered by other workflows
2626
workflow_call:
2727
# Define the input parameters for the workflow:
28-
inputs:
29-
pull_request_number:
30-
description: 'PR number'
31-
required: true
32-
type: number
33-
# Define the secrets accessible by the workflow:
34-
secrets:
35-
STDLIB_BOT_GITHUB_TOKEN:
36-
description: 'GitHub token for stdlb-bot'
37-
required: true
38-
REPO_GITHUB_TOKEN:
39-
description: 'GitHub token for accessing the repository'
40-
required: true
41-
STDLIB_BOT_GPG_PRIVATE_KEY:
42-
description: 'GPG private key for stdlb-bot'
43-
required: true
44-
STDLIB_BOT_GPG_PASSPHRASE:
45-
description: 'GPG passphrase for stdlb-bot'
46-
required: true
28+
inputs:
29+
pull_request_number:
30+
description: 'PR number'
31+
required: true
32+
type: number
33+
34+
# Define the secrets accessible by the workflow:
35+
secrets:
36+
STDLIB_BOT_GITHUB_TOKEN:
37+
description: 'GitHub token for stdlb-bot'
38+
required: true
39+
REPO_GITHUB_TOKEN:
40+
description: 'GitHub token for accessing the repository'
41+
required: true
42+
STDLIB_BOT_GPG_PRIVATE_KEY:
43+
description: 'GPG private key for stdlb-bot'
44+
required: true
45+
STDLIB_BOT_GPG_PASSPHRASE:
46+
description: 'GPG passphrase for stdlb-bot'
47+
required: true
4748

4849
# Workflow jobs:
4950
jobs:
@@ -100,7 +101,7 @@ jobs:
100101
# Install Node.js:
101102
- name: 'Install Node.js'
102103
# Pin action to full length commit SHA
103-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
104+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
104105
with:
105106
node-version: '20' # 'lts/*'
106107
timeout-minutes: 5
@@ -163,7 +164,7 @@ jobs:
163164
# Import GPG key to sign commits:
164165
- name: 'Import GPG key to sign commits'
165166
# Pin action to full length commit SHA
166-
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
167+
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
167168
with:
168169
gpg_private_key: ${{ secrets.STDLIB_BOT_GPG_PRIVATE_KEY }}
169170
passphrase: ${{ secrets.STDLIB_BOT_GPG_PASSPHRASE }}

.github/workflows/lint_changed_files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
# Install Node.js:
6868
- name: 'Install Node.js'
6969
# Pin action to full length commit SHA
70-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
70+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
7171
with:
7272
node-version: '20' # 'lts/*'
7373
timeout-minutes: 5
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2024 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: 'lint_copyright_years'
21+
22+
# Workflow triggers:
23+
on:
24+
pull_request:
25+
types: [opened, synchronize, reopened]
26+
27+
# Global permissions:
28+
permissions:
29+
# Allow read-only access to the repository contents:
30+
contents: read
31+
32+
# Workflow jobs:
33+
jobs:
34+
# Define a job for linting copyright years in newly added files:
35+
lint:
36+
name: 'Lint Copyright Years'
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
# Checkout the repository:
41+
- name: 'Checkout repository'
42+
# Pin action to full length commit SHA
43+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
44+
with:
45+
# Specify whether to remove untracked files before checking out the repository:
46+
clean: true
47+
48+
# Limit clone depth to the last 1000 commits:
49+
fetch-depth: 100
50+
51+
# Specify whether to download Git-LFS files:
52+
lfs: false
53+
timeout-minutes: 10
54+
55+
# Get list of newly added files:
56+
- name: 'Get list of newly added files'
57+
id: added-files
58+
run: |
59+
page=1
60+
files=""
61+
while true; do
62+
new_files=$(curl -s \
63+
-H "Accept: application/vnd.github.v3+json" \
64+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
65+
"${{ github.api_url }}/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files?page=$page&per_page=100" \
66+
| jq -r '.[] | select(.status == "added") | .filename')
67+
if [ -z "$new_files" ]; then
68+
break
69+
fi
70+
files="$files $new_files"
71+
page=$((page+1))
72+
done
73+
files=$(echo "$files" | tr '\n' ' ' | sed 's/^ //;s/ $//')
74+
echo "files=${files}" >> $GITHUB_OUTPUT
75+
76+
# Check copyright years in newly added files:
77+
- name: 'Check copyright years'
78+
run: |
79+
current_year=$(date +"%Y")
80+
files="${{ steps.added-files.outputs.files }}"
81+
exit_code=0
82+
83+
echo "## 📄 Copyright Year Check Results" >> $GITHUB_STEP_SUMMARY
84+
echo "_Only newly added files are checked for the current year in the copyright notice._" >> $GITHUB_STEP_SUMMARY
85+
echo "" >> $GITHUB_STEP_SUMMARY
86+
87+
if [[ -z "$files" ]]; then
88+
echo "No newly added files to check."
89+
echo "No newly added files to check." >> $GITHUB_STEP_SUMMARY
90+
exit 0
91+
fi
92+
93+
for file in $files; do
94+
if [[ ! -f "$file" ]]; then
95+
continue
96+
fi
97+
98+
# Check if file contains stdlib copyright notice:
99+
year=$(grep -o 'Copyright (c) [0-9]\{4\} The Stdlib Authors\.' "$file" | sed -E 's/^Copyright \(c\) ([0-9]{4}) The Stdlib Authors\./\1/' || true)
100+
101+
if [[ -n "$year" ]]; then
102+
if [[ "$year" == "$current_year" ]]; then
103+
echo "✅ $file: Correct year $year"
104+
echo "- ✅ \`$file\`: Year is correct (**$year**)" >> $GITHUB_STEP_SUMMARY
105+
else
106+
echo "❌ $file: Expected $current_year, found $year"
107+
echo "- ❌ **Error**: \`$file\` — Expected year **$current_year**, found **$year**" >> $GITHUB_STEP_SUMMARY
108+
exit_code=1
109+
fi
110+
else
111+
echo "⚠️ $file: No copyright notice found"
112+
echo "- ⚠️ No copyright notice found in \`$file\`" >> $GITHUB_STEP_SUMMARY
113+
fi
114+
done
115+
116+
exit $exit_code

.github/workflows/lint_pr_title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
# Install Node.js:
7272
- name: 'Install Node.js'
7373
# Pin action to full length commit SHA
74-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
74+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
7575
with:
7676
node-version: '20' # 'lts/*'
7777
timeout-minutes: 5

.github/workflows/lint_random_files.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
# Install Node.js:
109109
- name: 'Install Node.js'
110110
# Pin action to full length commit SHA
111-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
111+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
112112
with:
113113
node-version: '20' # 'lts/*'
114114
timeout-minutes: 5
@@ -414,7 +414,7 @@ jobs:
414414
- name: 'Import GPG key to sign commits'
415415
if: ${{ github.event.inputs.fix == 'true' }} && ( success() || failure() )
416416
# Pin action to full length commit SHA
417-
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
417+
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
418418
with:
419419
gpg_private_key: ${{ secrets.STDLIB_BOT_GPG_PRIVATE_KEY }}
420420
passphrase: ${{ secrets.STDLIB_BOT_GPG_PASSPHRASE }}
@@ -426,7 +426,7 @@ jobs:
426426
if: ${{ github.event.inputs.fix == 'true' }} && ( success() || failure() )
427427
id: cpr
428428
# Pin action to full length commit SHA
429-
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
429+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
430430
with:
431431
title: 'style: fix lint errors'
432432
add-paths: ${{ steps.random-files.outputs.files }}

.github/workflows/linux_benchmark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
# Install Node.js:
181181
- name: 'Install Node.js'
182182
# Pin action to full length commit SHA
183-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
183+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
184184
with:
185185
node-version: ${{ matrix.NODE_VERSION }}
186186
timeout-minutes: 5
@@ -251,7 +251,7 @@ jobs:
251251
# Upload the log file:
252252
- name: 'Upload log file'
253253
# Pin action to full length commit SHA
254-
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
254+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
255255
if: always()
256256
with:
257257
# Define a name for the uploaded artifact (ensuring a unique name for each job):

0 commit comments

Comments
 (0)