|
| 1 | +#/ |
| 2 | +# @license Apache-2.0 |
| 3 | +# |
| 4 | +# Copyright (c) 2023 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: discussion_comment_bot_response |
| 21 | + |
| 22 | +# Workflow triggers: |
| 23 | +on: |
| 24 | + discussion_comment: |
| 25 | + types: [created] |
| 26 | + |
| 27 | +# Workflow jobs: |
| 28 | +jobs: |
| 29 | + respond: |
| 30 | + # Define a display name: |
| 31 | + name: 'Respond to question' |
| 32 | + |
| 33 | + # Define the conditions under which the job should run: |
| 34 | + if : github.event.comment.body && startsWith( github.event.comment.body, '/ask ' ) |
| 35 | + |
| 36 | + # Define the type of virtual host machine: |
| 37 | + runs-on: ubuntu-latest |
| 38 | + |
| 39 | + # Define the sequence of job steps: |
| 40 | + steps: |
| 41 | + # Checkout the repository with LFS caching: |
| 42 | + - name: 'Checkout repository' |
| 43 | + uses: nschloe/action-cached-lfs-checkout@v1 |
| 44 | + |
| 45 | + # Run the chatbot action: |
| 46 | + - name: 'Run chatbot action' |
| 47 | + uses: stdlib-js/stdlib-chat-bot@main |
| 48 | + with: |
| 49 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 50 | + GITHUB_TOKEN: ${{ secrets.CHATBOT_GITHUB_TOKEN }} |
0 commit comments