Answer Discussions #8
This file contains hidden or 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
| # .github/workflows/answer-discussions.yml | |
| name: Answer Discussions | |
| on: | |
| discussion: | |
| types: [created] | |
| jobs: | |
| answer: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| discussions: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests azure-ai-inference azure-core | |
| - name: Answer discussion | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} # GitHub PAT | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| run: python scripts/answer_discussion.py ${{ github.event.discussion.number }} |