Discussion Labeler #54
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
| name: Discussion Labeler | |
| on: | |
| workflow_dispatch: # Allow manual triggering | |
| discussion: | |
| types: [created] # Trigger only when a new discussion is created | |
| # Use permissions directive to explicitly set token permissions | |
| permissions: | |
| contents: read | |
| discussions: write # Only needed to read/label discussions | |
| jobs: | |
| label-discussions: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/[email protected] | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r discussion_labeler/requirements.txt | |
| - name: Run discussion labeler | |
| env: | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| APP_ID: ${{ secrets.APP_ID }} | |
| APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} | |
| APP_INSTALLATION_ID: ${{ secrets.APP_INSTALLATION_ID }} | |
| DEFAULT_REPO: ${{ github.repository }} | |
| REQUEST_TIMEOUT: "30" | |
| RUN_INTERVAL_MINUTES: "300" | |
| SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
| AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }} | |
| AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} | |
| AZURE_OPENAI_KEY: ${{ secrets.AZURE_OPENAI_KEY }} | |
| run: | | |
| python -c "from discussion_labeler import basic; basic.process_discussions()" |