Skip to content

Github Issue Notification #24

Github Issue Notification

Github Issue Notification #24

name: Github Issue Notification
on:
# When a new issue is opened
issues:
types:
- opened
# When manually triggering the workflow
workflow_dispatch:
inputs:
issue_number:
description: 'Issue number to process'
required: true
type: number
jobs:
process_issue:
runs-on: ubuntu-latest
environment: protected-dev-env
steps:
- name: Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python 3.x
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.x'
- name: Install Dependencies
run: |
cd tools/issue_handler
pip install -r requirements.txt
- name: Set Issue Number
run: |
if [ "${{ github.event_name }}" = "issues" ]; then
echo "GITHUB_EVENT_NUMBER=${{ github.event.issue.number }}" >> $GITHUB_ENV
else
echo "GITHUB_EVENT_NUMBER=${{ github.event.inputs.issue_number }}" >> $GITHUB_ENV
fi
- name: Run the Processing Script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
OPENAI_SYSTEM_PROMPT: ${{ vars.OPENAI_SYSTEM_PROMPT }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
cd tools/issue_handler
# Add timeout to prevent hanging processes (5 minutes)
timeout 300 python -m src.analyze_issue $GITHUB_EVENT_NUMBER