Skip to content

feat: add C implementation for stats/base/dists/geometric/entropy #7691

feat: add C implementation for stats/base/dists/geometric/entropy

feat: add C implementation for stats/base/dists/geometric/entropy #7691

Workflow file for this run

#/
# @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: labeler
# Workflow triggers:
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- edited
- review_requested
- review_request_removed
- ready_for_review
- converted_to_draft
- labeled
# Workflow jobs:
jobs:
# Define a job which automatically labels pull requests based on the contents of the pull request:
labeler:
# Define job name:
name: 'Labeler'
# Only run this job if the pull request did not have label `automated-pr`:
if: contains(github.event.pull_request.labels.*.name, 'automated-pr') == false
# Define job permissions:
permissions:
contents: read
pull-requests: write
# Define the type of virtual host machine:
runs-on: ubuntu-latest
# Define the sequence of job steps:
steps:
# Automatically label pull requests:
- name: 'Automatically label pull requests'
# Pin action to full length commit SHA
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
configuration-path: .github/labeler.yml
repo-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
# Add "Needs Review" label when PR is opened and not a draft:
- name: 'Add "Needs Review" label if PR is opened and not draft'
if: ${{ github.event.action == 'opened' && github.event.pull_request.draft == false }}
# Pin action to full length commit SHA
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
script: |
await github.rest.issues.addLabels({
'owner': context.repo.owner,
'repo': context.repo.repo,
'issue_number': context.payload.pull_request.number,
'labels': [ 'Needs Review' ]
})
# Add "Needs Review" label when PR is marked ready for review or review is requested:
- name: 'Add "Needs Review" label if PR is ready for review or review is requested'
if: ${{ github.event.action == 'ready_for_review' || github.event.action == 'review_requested' }}
# Pin action to full length commit SHA
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
script: |
await github.rest.issues.addLabels({
'owner': context.repo.owner,
'repo': context.repo.repo,
'issue_number': context.payload.pull_request.number,
'labels': [ 'Needs Review' ]
})
# Remove "Needs Review" label when PR is converted to draft or closed:
- name: 'Remove "Needs Review" label if PR is converted to draft or closed'
if: ${{ github.event.action == 'converted_to_draft' || github.event.action == 'closed' }}
# Pin action to full length commit SHA
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
script: |
try {
await github.rest.issues.removeLabel({
'owner': context.repo.owner,
'repo': context.repo.repo,
'issue_number': context.payload.pull_request.number,
'name': 'Needs Review'
})
} catch ( error ) {
console.log( 'Error removing label: %s', error.message );
}
# Remove "Needs Review" and "Needs Changes" labels when "Ready To Merge" is assigned:
- name: 'Remove "Needs Review" and "Needs Changes" labels when "Ready To Merge" is assigned'
if: ${{ github.event.action == 'labeled' && github.event.label.name == 'Ready To Merge' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
script: |
const labelsToRemove = [ 'Needs Review', 'Needs Changes' ];
for ( const label of labelsToRemove ) {
try {
await github.rest.issues.removeLabel({
'owner': context.repo.owner,
'repo': context.repo.repo,
'issue_number': context.payload.pull_request.number,
'name': label
})
} catch ( error ) {
console.log( 'Error removing label %s: %s', label, error.message );
}
}