Skip to content

Adding issue listener workflow #1

Adding issue listener workflow

Adding issue listener workflow #1

name: Issue Listener
on:

Check failure on line 3 in .github/workflows/issue_listener.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/issue_listener.yml

Invalid workflow file

You have an error in your yaml syntax on line 3
issues:
types: [opened]
jobs:
post_issue_to_backend:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Post issue to backend
env:
ISSUE_URL: ${{ github.event.issue.html_url }}
ISSUE_SUMMARY: ${{ github.event.issue.title }}
ISSUE_DESCRIPTION: ${{ github.event.issue.body }}
run: |
COMMIT=$(git rev-parse HEAD)
COMMIT_TIMESTAMP=$(date +%s)
REPORT_TIMESTAMP=$(date +%s)
RESPONSE=$(curl -X POST https://ffa3-103-198-136-205.ngrok-free.app/api/v2/issues \
-H "Content-Type: application/json" \
-d '{
"issueURL": "'"$ISSUE_URL"'",
"issueSummary": "'"$ISSUE_SUMMARY"'",
"issueDescription": "'"$ISSUE_DESCRIPTION"'",
"commit": "'"$COMMIT"'",
"commitTimestamp": "'"$COMMIT_TIMESTAMP"'",
"reportTimestamp": "'"$REPORT_TIMESTAMP"'"
}')
echo "Backend response: $RESPONSE"
curl -X POST https://api.github.com/repos/SampadSikder/aspectj/issues/${{ github.event.issue.number }}/comments \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"body": "Issue processed successfully. Backend response: '$RESPONSE'"
}'