mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-04-23 04:16:29 +02:00
070e40ffe0
Bumps the github-actions group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml](https://github.com/google/osv-scanner-action), [ridedott/merge-me-action](https://github.com/ridedott/merge-me-action) and [google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml](https://github.com/google/osv-scanner-action). Updates `actions/checkout` from 5.0.0 to 6.0.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/08c6903cd8c0fde910a37f88322edcfb5dd907a8...1af3b93b6815bc44a9784bd300feb67ff0d1eeb3) Updates `google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml` from 2.2.4 to 2.3.0 - [Release notes](https://github.com/google/osv-scanner-action/releases) - [Commits](https://github.com/google/osv-scanner-action/compare/9bb69575e74019c2ad085a1860787043adf47ccb...b77c075a1235514558f0eb88dbd31e22c45e0cd2) Updates `ridedott/merge-me-action` from 2.10.134 to 2.10.138 - [Release notes](https://github.com/ridedott/merge-me-action/releases) - [Changelog](https://github.com/ridedott/merge-me-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/ridedott/merge-me-action/compare/a8b93e4510b1cb03192d058ddef97e6b1de25522...18dd4f01d259faf0a2d900a56cd6b7e765009209) Updates `google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml` from 2.2.4 to 2.3.0 - [Release notes](https://github.com/google/osv-scanner-action/releases) - [Commits](https://github.com/google/osv-scanner-action/compare/9bb69575e74019c2ad085a1860787043adf47ccb...b77c075a1235514558f0eb88dbd31e22c45e0cd2) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml dependency-version: 2.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: ridedott/merge-me-action dependency-version: 2.10.138 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml dependency-version: 2.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
200 lines
7.4 KiB
YAML
200 lines
7.4 KiB
YAML
name: Issue Validation
|
|
|
|
on:
|
|
issues:
|
|
types: [opened]
|
|
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
models: read
|
|
|
|
jobs:
|
|
validate-issue:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
|
|
|
|
- name: Get issue templates
|
|
id: get-templates
|
|
run: |
|
|
# Read the issue templates
|
|
if [ -f ".github/ISSUE_TEMPLATE/01-bug-report.md" ]; then
|
|
echo "bug-template-exists=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
if [ -f ".github/ISSUE_TEMPLATE/02-feature-request.md" ]; then
|
|
echo "feature-template-exists=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Create issue analysis prompt
|
|
id: create-prompt
|
|
env:
|
|
ISSUE_TITLE: ${{ github.event.issue.title }}
|
|
ISSUE_BODY: ${{ github.event.issue.body }}
|
|
ISSUE_LABELS: ${{ join(github.event.issue.labels.*.name, ', ') }}
|
|
run: |
|
|
cat > issue_analysis.txt << EOF
|
|
## Issue Content to Analyze:
|
|
|
|
**Title:** $ISSUE_TITLE
|
|
|
|
**Body:**
|
|
$ISSUE_BODY
|
|
|
|
**Labels:** $ISSUE_LABELS
|
|
EOF
|
|
|
|
- name: Validate issue with AI
|
|
id: validate
|
|
uses: actions/ai-inference@a1c11829223a786afe3b5663db904a3aa1eac3a2 # v2.0.1
|
|
with:
|
|
prompt-file: issue_analysis.txt
|
|
system-prompt: |
|
|
You are an issue validation assistant for Donut Browser, an anti-detect browser.
|
|
|
|
Analyze the provided issue content and determine if it contains sufficient information based on these requirements:
|
|
|
|
**For Bug Reports, the issue should include:**
|
|
1. Clear description of the problem
|
|
2. Steps to reproduce the issue (numbered list preferred)
|
|
3. Expected vs actual behavior
|
|
4. Environment information (OS, browser version, etc.)
|
|
5. Error messages, stack traces, or screenshots if applicable
|
|
|
|
**For Feature Requests, the issue should include:**
|
|
1. Clear description of the requested feature
|
|
2. Use case or problem it solves
|
|
3. Proposed solution or how it should work
|
|
4. Priority level or importance
|
|
|
|
**General Requirements for all issues:**
|
|
1. Descriptive title
|
|
2. Sufficient detail to understand and act upon
|
|
3. Professional tone and clear communication
|
|
|
|
Respond in JSON format with the following structure:
|
|
```json
|
|
{
|
|
"is_valid": true|false,
|
|
"issue_type": "bug_report"|"feature_request"|"other",
|
|
"missing_info": [
|
|
"List of missing required information"
|
|
],
|
|
"suggestions": [
|
|
"Specific suggestions for improvement"
|
|
],
|
|
"overall_assessment": "Brief assessment of the issue quality"
|
|
}
|
|
```
|
|
|
|
Be constructive and helpful in your feedback. If the issue is incomplete, provide specific guidance on what's needed.
|
|
model: openai/gpt-4o
|
|
|
|
- name: Parse validation result and take action
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
# Prefer reading from the response file to avoid output truncation
|
|
RESPONSE_FILE='${{ steps.validate.outputs.response-file }}'
|
|
if [ -n "$RESPONSE_FILE" ] && [ -f "$RESPONSE_FILE" ]; then
|
|
RAW_OUTPUT=$(cat "$RESPONSE_FILE")
|
|
else
|
|
RAW_OUTPUT='${{ steps.validate.outputs.response }}'
|
|
fi
|
|
|
|
# Extract JSON if wrapped in markdown code fences; otherwise use raw
|
|
JSON_RESULT=$(printf "%s" "$RAW_OUTPUT" | sed -n '/```json/,/```/p' | sed '1d;$d')
|
|
if [ -z "$JSON_RESULT" ]; then
|
|
JSON_RESULT="$RAW_OUTPUT"
|
|
fi
|
|
|
|
# Parse JSON fields
|
|
IS_VALID=$(echo "$JSON_RESULT" | jq -r '.is_valid // false')
|
|
ISSUE_TYPE=$(echo "$JSON_RESULT" | jq -r '.issue_type // "other"')
|
|
MISSING_INFO=$(echo "$JSON_RESULT" | jq -r '.missing_info[]? // empty' | sed 's/^/- /')
|
|
SUGGESTIONS=$(echo "$JSON_RESULT" | jq -r '.suggestions[]? // empty' | sed 's/^/- /')
|
|
ASSESSMENT=$(echo "$JSON_RESULT" | jq -r '.overall_assessment // "No assessment provided"')
|
|
|
|
echo "Issue validation result: $IS_VALID"
|
|
echo "Issue type: $ISSUE_TYPE"
|
|
|
|
if [ "$IS_VALID" = "false" ]; then
|
|
# Create a comment asking for more information
|
|
cat > comment.md << EOF
|
|
## 🤖 Issue Validation
|
|
|
|
Thank you for submitting this issue! However, it appears that some required information might be missing to help us better understand and address your concern.
|
|
|
|
**Issue Type Detected:** \`$ISSUE_TYPE\`
|
|
|
|
**Assessment:** $ASSESSMENT
|
|
|
|
### 📋 Missing Information:
|
|
$MISSING_INFO
|
|
|
|
### 💡 Suggestions for Improvement:
|
|
$SUGGESTIONS
|
|
|
|
### 📝 How to Provide Additional Information:
|
|
|
|
Please edit your original issue description to include the missing information. Here are our issue templates for reference:
|
|
|
|
- **Bug Report Template:** [View Template](.github/ISSUE_TEMPLATE/01-bug-report.md)
|
|
- **Feature Request Template:** [View Template](.github/ISSUE_TEMPLATE/02-feature-request.md)
|
|
|
|
### 🔧 Quick Tips:
|
|
- For **bug reports**: Include step-by-step reproduction instructions, your environment details, and any error messages
|
|
- For **feature requests**: Describe the use case, expected behavior, and why this feature would be valuable
|
|
- Add **screenshots** or **logs** when applicable
|
|
|
|
Once you've updated the issue with the missing information, feel free to remove this comment or reply to let us know you've made the updates.
|
|
|
|
---
|
|
*This validation was performed automatically to ensure we have all the information needed to help you effectively.*
|
|
EOF
|
|
|
|
# Post the comment
|
|
gh issue comment ${{ github.event.issue.number }} --body-file comment.md
|
|
|
|
# Add a label to indicate validation needed
|
|
gh issue edit ${{ github.event.issue.number }} --add-label "needs-info"
|
|
|
|
echo "✅ Validation comment posted and 'needs-info' label added"
|
|
else
|
|
echo "✅ Issue contains sufficient information"
|
|
|
|
# Prepare a summary comment even when valid
|
|
cat > comment.md << EOF
|
|
## 🤖 Issue Validation
|
|
|
|
**Issue Type Detected:** \`$ISSUE_TYPE\`
|
|
|
|
**Assessment:** $ASSESSMENT
|
|
|
|
$( [ -n "$SUGGESTIONS" ] && echo "### 💡 Suggestions:" && echo "$SUGGESTIONS" )
|
|
|
|
---
|
|
*This validation was performed automatically to help triage issues.*
|
|
EOF
|
|
|
|
# Post the summary comment
|
|
gh issue comment ${{ github.event.issue.number }} --body-file comment.md
|
|
|
|
# Add appropriate labels based on issue type
|
|
case "$ISSUE_TYPE" in
|
|
"bug_report")
|
|
gh issue edit ${{ github.event.issue.number }} --add-label "bug"
|
|
;;
|
|
"feature_request")
|
|
gh issue edit ${{ github.event.issue.number }} --add-label "enhancement"
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
- name: Cleanup
|
|
run: |
|
|
rm -f issue_analysis.txt comment.md
|