Skip to content

Commit 45ab619

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents a32c8b2 + a0ba090 commit 45ab619

File tree

111 files changed

+6034
-419
lines changed

Some content is hidden

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

111 files changed

+6034
-419
lines changed

.github/workflows/generate_pr_commit_message.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,21 @@ jobs:
7070
id: commit_message
7171
run: |
7272
COMMIT_MESSAGE=$($GITHUB_WORKSPACE/.github/workflows/scripts/generate_pr_commit_message $PR_NUMBER)
73+
EXIT_CODE=$?
74+
7375
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
7476
echo "$COMMIT_MESSAGE" >> $GITHUB_OUTPUT
7577
echo "EOF" >> $GITHUB_OUTPUT
7678
79+
if [ $EXIT_CODE -eq 200 ]; then
80+
echo "has_tracking_issue=true" >> $GITHUB_OUTPUT
81+
else
82+
echo "has_tracking_issue=false" >> $GITHUB_OUTPUT
83+
fi
84+
85+
# Ensure the script itself doesn't fail the workflow:
86+
exit 0
87+
7788
# Post commit message as PR comment:
7889
- name: 'Post commit message as PR comment'
7990
uses: peter-evans/create-or-update-comment@v4
@@ -88,3 +99,5 @@ jobs:
8899
```
89100
90101
*Please review the above commit message and make any necessary adjustments.*
102+
103+
${{ steps.commit_message.outputs.has_tracking_issue == 'true' && '⚠️ **Action Required**: This PR references tracking issues. Please update the PR description to replace any "Closes", "Fixes", or "Resolves" keywords with "Ref" when referencing these issues.' || '' }}
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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: git_note_amend_message
21+
22+
# Workflow triggers:
23+
on:
24+
# Allow the workflow to be manually run:
25+
workflow_dispatch:
26+
# Define the input parameters for the workflow:
27+
inputs:
28+
commit_hash:
29+
description: 'Commit hash to create note for'
30+
required: true
31+
type: string
32+
message:
33+
description: 'New commit message'
34+
required: true
35+
type: string
36+
37+
# Allow the workflow to be triggered by other workflows:
38+
workflow_call:
39+
# Define the input parameters for the workflow:
40+
inputs:
41+
commit_hash:
42+
description: 'Commit hash to create note for'
43+
required: true
44+
type: string
45+
message:
46+
description: 'New commit message'
47+
required: true
48+
type: string
49+
50+
# Define the secrets accessible by the workflow:
51+
secrets:
52+
STDLIB_BOT_GITHUB_TOKEN:
53+
description: 'GitHub token for stdlib-bot'
54+
required: true
55+
REPO_GITHUB_TOKEN:
56+
description: 'GitHub token for accessing the repository'
57+
required: true
58+
STDLIB_BOT_GPG_PRIVATE_KEY:
59+
description: 'GPG private key for stdlib-bot'
60+
required: true
61+
STDLIB_BOT_GPG_PASSPHRASE:
62+
description: 'GPG passphrase for stdlib-bot'
63+
required: true
64+
65+
# Workflow jobs:
66+
jobs:
67+
68+
# Define a job to create a Git note amending a commit message:
69+
create_git_note_amending_commit_message:
70+
71+
# Define job name:
72+
name: 'Create Git Note Amending Commit Message'
73+
74+
# Define the type of virtual host machine:
75+
runs-on: ubuntu-latest
76+
77+
# Define the sequence of job steps:
78+
steps:
79+
# Checkout the repository:
80+
- name: 'Checkout repository'
81+
# Pin action to full length commit SHA
82+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
83+
with:
84+
# Fetch all history to allow creating a Git note for any commit:
85+
fetch-depth: 0
86+
87+
# Token for accessing the repository:
88+
token: ${{ secrets.REPO_GITHUB_TOKEN }}
89+
90+
# Verify commit exists:
91+
- name: 'Verify commit exists'
92+
run: |
93+
if ! git rev-parse --quiet --verify ${{ inputs.commit_hash }}^{commit}; then
94+
echo "Error: Commit ${{ inputs.commit_hash }} not found"
95+
exit 1
96+
fi
97+
98+
# Create Git note:
99+
- name: 'Create Git note'
100+
run: |
101+
# Create Git note file:
102+
cat > "docs/git-notes/${{ inputs.commit_hash }}.txt" << EOF
103+
---
104+
type: amend-message
105+
---
106+
EOF
107+
108+
# Append new commit message to Git note file:
109+
echo -e '${{ inputs.message }}' >> "docs/git-notes/${{ inputs.commit_hash }}.txt"
110+
111+
# Create step summary:
112+
echo "## Note for commit ${{ inputs.commit_hash }}:" >> $GITHUB_STEP_SUMMARY
113+
cat "docs/git-notes/${{ inputs.commit_hash }}.txt" >> $GITHUB_STEP_SUMMARY
114+
115+
# Disable Git hooks:
116+
- name: 'Disable Git hooks'
117+
run: |
118+
rm -rf .git/hooks
119+
120+
# Import GPG key to sign commits:
121+
- name: 'Import GPG key to sign commits'
122+
# Pin action to full length commit SHA
123+
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
124+
with:
125+
gpg_private_key: ${{ secrets.STDLIB_BOT_GPG_PRIVATE_KEY }}
126+
passphrase: ${{ secrets.STDLIB_BOT_GPG_PASSPHRASE }}
127+
git_user_signingkey: true
128+
git_commit_gpgsign: true
129+
130+
# Commit and push changes:
131+
- name: 'Commit and push changes'
132+
env:
133+
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
134+
USER_NAME: stdlib-bot
135+
run: |
136+
git config --local user.email "[email protected]"
137+
git config --local user.name "${USER_NAME}"
138+
139+
git add "docs/git-notes/${{ inputs.commit_hash }}.txt"
140+
git commit -m "docs: add Git note for commit ${{ inputs.commit_hash }}"
141+
git push
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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: git_note_filter_packages
21+
22+
# Workflow triggers:
23+
on:
24+
# Allow the workflow to be manually run:
25+
workflow_dispatch:
26+
# Define the input parameters for the workflow:a
27+
inputs:
28+
commit_hash:
29+
description: 'Commit hash to create note for'
30+
required: true
31+
type: string
32+
excludes:
33+
description: 'Comma-separated list of packages to exclude'
34+
required: true
35+
type: string
36+
37+
# Allow the workflow to be triggered by other workflows:
38+
workflow_call:
39+
# Define the input parameters for the workflow:
40+
inputs:
41+
commit_hash:
42+
description: 'Commit hash to create note for'
43+
required: true
44+
type: string
45+
excludes:
46+
description: 'Comma-separated list of packages to exclude'
47+
required: true
48+
type: string
49+
50+
# Define the secrets accessible by the workflow:
51+
secrets:
52+
STDLIB_BOT_GITHUB_TOKEN:
53+
description: 'GitHub token for stdlib-bot'
54+
required: true
55+
REPO_GITHUB_TOKEN:
56+
description: 'GitHub token for accessing the repository'
57+
required: true
58+
STDLIB_BOT_GPG_PRIVATE_KEY:
59+
description: 'GPG private key for stdlib-bot'
60+
required: true
61+
STDLIB_BOT_GPG_PASSPHRASE:
62+
description: 'GPG passphrase for stdlib-bot'
63+
required: true
64+
65+
# Workflow jobs:
66+
jobs:
67+
68+
# Define a job to create a Git note amending a commit message:
69+
create_git_note_filtering_packages:
70+
71+
# Define job name:
72+
name: 'Create Git Note Filtering Packages for Commit'
73+
74+
# Define the type of virtual host machine:
75+
runs-on: ubuntu-latest
76+
77+
# Define the sequence of job steps:
78+
steps:
79+
# Checkout the repository:
80+
- name: 'Checkout repository'
81+
# Pin action to full length commit SHA
82+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
83+
with:
84+
# Fetch all history to allow creating a Git note for any commit:
85+
fetch-depth: 0
86+
87+
# Token for accessing the repository:
88+
token: ${{ secrets.REPO_GITHUB_TOKEN }}
89+
90+
# Verify commit exists:
91+
- name: 'Verify commit exists'
92+
run: |
93+
if ! git rev-parse --quiet --verify ${{ inputs.commit_hash }}^{commit}; then
94+
echo "Error: Commit ${{ inputs.commit_hash }} not found"
95+
exit 1
96+
fi
97+
98+
# Create Git note:
99+
- name: 'Create Git note'
100+
run: |
101+
# Start creating the note file:
102+
cat > "docs/git-notes/${{ inputs.commit_hash }}.txt" << 'EOF'
103+
---
104+
type: filter-packages
105+
exclude:
106+
EOF
107+
108+
# Process the comma-separated input and add each package as a YAML list item:
109+
echo "${{ inputs.excludes }}" | tr ',' '\n' | while IFS= read -r package; do
110+
# Trim whitespace and skip empty entries...
111+
package=$(echo "$package" | xargs)
112+
if [ -n "$package" ]; then
113+
echo " - $package" >> "docs/git-notes/${{ inputs.commit_hash }}.txt"
114+
fi
115+
done
116+
117+
# Add final YAML delimiter:
118+
echo "---" >> "docs/git-notes/${{ inputs.commit_hash }}.txt"
119+
120+
# Create step summary:
121+
echo "## Note for commit ${{ inputs.commit_hash }}:" >> $GITHUB_STEP_SUMMARY
122+
cat "docs/git-notes/${{ inputs.commit_hash }}.txt" >> $GITHUB_STEP_SUMMARY
123+
124+
# Disable Git hooks:
125+
- name: 'Disable Git hooks'
126+
run: |
127+
rm -rf .git/hooks
128+
129+
# Import GPG key to sign commits:
130+
- name: 'Import GPG key to sign commits'
131+
# Pin action to full length commit SHA
132+
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
133+
with:
134+
gpg_private_key: ${{ secrets.STDLIB_BOT_GPG_PRIVATE_KEY }}
135+
passphrase: ${{ secrets.STDLIB_BOT_GPG_PASSPHRASE }}
136+
git_user_signingkey: true
137+
git_commit_gpgsign: true
138+
139+
# Commit and push changes:
140+
- name: 'Commit and push changes'
141+
env:
142+
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
143+
USER_NAME: stdlib-bot
144+
run: |
145+
git config --local user.email "[email protected]"
146+
git config --local user.name "${USER_NAME}"
147+
148+
git add "docs/git-notes/${{ inputs.commit_hash }}.txt"
149+
git commit -m "docs: add Git note for commit ${{ inputs.commit_hash }}"
150+
git push

.github/workflows/lint_autofix.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ on:
3434
# Define the secrets accessible by the workflow:
3535
secrets:
3636
STDLIB_BOT_GITHUB_TOKEN:
37-
description: 'GitHub token for stdlb-bot'
37+
description: 'GitHub token for stdlib-bot'
3838
required: true
3939
REPO_GITHUB_TOKEN:
4040
description: 'GitHub token for accessing the repository'
4141
required: true
4242
STDLIB_BOT_GPG_PRIVATE_KEY:
43-
description: 'GPG private key for stdlb-bot'
43+
description: 'GPG private key for stdlib-bot'
4444
required: true
4545
STDLIB_BOT_GPG_PASSPHRASE:
46-
description: 'GPG passphrase for stdlb-bot'
46+
description: 'GPG passphrase for stdlib-bot'
4747
required: true
4848

4949
# Workflow jobs:
@@ -175,12 +175,12 @@ jobs:
175175
- name: 'Commit and push changes'
176176
env:
177177
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
178-
USER_NAME: stdlb-bot
178+
USER_NAME: stdlib-bot
179179
BRANCH_NAME: ${{ steps.pr-details.outputs.branch }}
180180
REPO_NAME: ${{ steps.pr-details.outputs.repository }}
181181
run: |
182182
git config --local user.email "[email protected]"
183-
git config --local user.name "stdlib-bot"
183+
git config --local user.name "$USER_NAME"
184184
git add .
185185
git commit -m "fix: resolve lint errors"
186186
git push "https://$USER_NAME:[email protected]/$REPO_NAME.git" $BRANCH_NAME

.github/workflows/lint_changed_files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ jobs:
257257
- name: 'Setup R'
258258
if: ( success() || failure() ) && steps.check-r-files.outputs.files != ''
259259
# Pin action to full length commit SHA
260-
uses: r-lib/actions/setup-r@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2.10.1
260+
uses: r-lib/actions/setup-r@473c68190595b311a74f208fba61a8d8c0d4c247 # v2.11.1
261261
with:
262262
r-version: '3.5.3'
263263

.github/workflows/lint_random_files.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ jobs:
326326
- name: 'Setup R'
327327
if: ( github.event.inputs.r != 'false' ) && ( success() || failure() )
328328
# Pin action to full length commit SHA
329-
uses: r-lib/actions/setup-r@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2.10.1
329+
uses: r-lib/actions/setup-r@473c68190595b311a74f208fba61a8d8c0d4c247 # v2.11.1
330330
with:
331331
r-version: '4.3.3'
332332

@@ -397,7 +397,7 @@ jobs:
397397
ERROR_LOG=$(mktemp)
398398
grep -B 1 -A 2 "style:\|warning:\|error:" <<< "${{ steps.lint-c.outputs.stderr }}" > $ERROR_LOG
399399
400-
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_lint_sub_issue.sh" \
400+
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_lint_sub_issue" \
401401
"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
402402
"C" \
403403
"3235" \ # Number of C lint error tracking issue

0 commit comments

Comments
 (0)