-
-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop' into reimann-zeta
- Loading branch information
Showing
6,432 changed files
with
485,688 additions
and
29,455 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#/ | ||
# @license Apache-2.0 | ||
# | ||
# Copyright (c) 2024 The Stdlib Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#/ | ||
|
||
# Workflow name: | ||
name: cleanup_coverage | ||
|
||
# Workflow triggers: | ||
on: | ||
|
||
# Trigger the workflow when a pull request is closed (e.g., merged or closed without merging): | ||
pull_request_target: | ||
types: | ||
- closed | ||
|
||
# Workflow jobs: | ||
jobs: | ||
|
||
# Define a job to perform coverage cleanup... | ||
cleanup: | ||
|
||
# Define a display name: | ||
name: 'Cleanup coverage' | ||
|
||
# Define the type of virtual host machine: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Delete the 'pr-<number>' branch from the 'stdlib-js/www-test-code-coverage' repository: | ||
- name: 'Delete coverage branch for PR' | ||
env: | ||
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
run: | | ||
curl -X DELETE -H "Authorization: token $REPO_GITHUB_TOKEN" \ | ||
"https://api.github.com/repos/stdlib-js/www-test-code-coverage/git/refs/heads/pr-${PR_NUMBER}" \ | ||
|| echo "Branch pr-${PR_NUMBER} does not exist or could not be deleted." | ||
# Find and update the '## Coverage Report' comment in the PR | ||
- name: 'Update coverage comment in PR' | ||
# Pin action to full length commit SHA | ||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
with: | ||
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }} | ||
script: | | ||
const prNumber = context.payload.pull_request.number; | ||
const { data: comments } = await github.rest.issues.listComments({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: prNumber, | ||
}); | ||
const coverageComment = comments.find( comment => comment.body && comment.body.includes( '## Coverage Report' ) ); | ||
if ( coverageComment ) { | ||
// Replace URLs with plain text in the coverage report comment body: | ||
const updatedBody = coverageComment.body.replace( /<a href="[^"]+">([^<]+)<\/a>/g, '$1' ); | ||
await github.rest.issues.updateComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
comment_id: coverageComment.id, | ||
body: updatedBody, | ||
}); | ||
} else { | ||
console.log( 'No Coverage Report comment found.' ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#/ | ||
# @license Apache-2.0 | ||
# | ||
# Copyright (c) 2024 The Stdlib Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#/ | ||
|
||
# Workflow name: | ||
name: generate_pr_commit_message | ||
|
||
# Workflow triggers: | ||
on: | ||
pull_request_target: | ||
types: | ||
- labeled | ||
|
||
# Global permissions: | ||
permissions: | ||
# Allow read-only access to the repository contents: | ||
contents: read | ||
|
||
# Allow write access to issues, assignees, labels, and milestones: | ||
issues: write | ||
|
||
# Allow write access to pull requests: | ||
pull-requests: write | ||
|
||
# Workflow jobs: | ||
jobs: | ||
|
||
# Job to generate commit message draft: | ||
generate-commit-message: | ||
|
||
# Define a display name: | ||
name: 'Generate PR Commit Message Draft' | ||
|
||
# Define the type of virtual host machine: | ||
runs-on: ubuntu-latest | ||
|
||
# Ensure the job only runs when the specified label is added: | ||
if: github.event.label.name == 'Ready to Merge' | ||
|
||
# Define environment variables: | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
|
||
# Define the sequence of job steps... | ||
steps: | ||
# Checkout repository: | ||
- name: 'Checkout repository' | ||
uses: actions/checkout@v4 | ||
with: | ||
# Fetch all commits to ensure we have the full commit history: | ||
fetch-depth: 0 | ||
|
||
# Generate commit message: | ||
- name: 'Generate commit message' | ||
id: commit_message | ||
run: | | ||
COMMIT_MESSAGE=$($GITHUB_WORKSPACE/.github/workflows/scripts/generate_pr_commit_message $PR_NUMBER) | ||
echo "commit_message<<EOF" >> $GITHUB_OUTPUT | ||
echo "$COMMIT_MESSAGE" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
# Post commit message as PR comment: | ||
- name: 'Post commit message as PR comment' | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.CHATBOT_GITHUB_TOKEN }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
### PR Commit Message | ||
```text | ||
${{ steps.commit_message.outputs.commit_message }} | ||
``` | ||
*Please review the above commit message and make any necessary adjustments.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.