Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Auto Create Issues Every 10 Minutes #1947

Auto Create Issues Every 10 Minutes

Auto Create Issues Every 10 Minutes #1947

name: Auto Create Issues Every 10 Minutes
on:
schedule:
- cron: '*/10 * * * *'
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
create-issue:
runs-on: ubuntu-latest
steps:
- name: ✅ Debug - Workflow started
run: echo "🟢 Workflow triggered successfully!"
- name: Generate Issue Using Gemini 1.5 Flash
id: generate
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=$GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts": [{
"text": "Generate a documentation with Markdown about a randomly chosen problem developers face in Firebase Firestore, data storing and posts. Include:
- A Markdown H1 title
- Description of the error
- full code of fixing step by step
- external references with links
- Explanation
- End with: Copyrights (c) OpenRockets Open-source Network. Free to use, copy, share, edit or publish."
}]
}]
}' > response.json
- name: Extract Title and Body from Gemini Response
id: parse
run: |
CONTENT=$(jq -r '.candidates[0].content.parts[0].text' response.json)
echo "$CONTENT" > full.md
TITLE=$(head -n 1 full.md | sed 's/^# //')
echo "$TITLE" > title.txt
tail -n +2 full.md > issue-body.md
echo "title=$TITLE" >> $GITHUB_ENV # Pass title to next step
- name: Debug - Show extracted content
run: |
echo "TITLE:"
cat title.txt
echo "BODY:"
cat issue-body.md
- name: Create GitHub Issue
uses: peter-evans/create-issue-from-file@v5
with:
title: ${{ env.title }}
content-filepath: issue-body.md
labels: documentation, web
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}