Skip to content

Github Issue Notification #2

Github Issue Notification

Github Issue Notification #2

name: Github Issue Notification
on:
workflow_dispatch: # Trigger manually
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Python 3.x
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.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