Skip to content

deps(frontend)(deps-dev): bump vite from 6.3.5 to 7.1.2 in /frontend #4

deps(frontend)(deps-dev): bump vite from 6.3.5 to 7.1.2 in /frontend

deps(frontend)(deps-dev): bump vite from 6.3.5 to 7.1.2 in /frontend #4

name: πŸ€– Dependabot Auto-merge
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: write
pull-requests: write
jobs:
# ═══════════════════════════════════════════════════════════════════════════════
# πŸ€– DEPENDABOT PR HANDLING
# ═══════════════════════════════════════════════════════════════════════════════
dependabot-auto-merge:
name: πŸ€– Dependabot Auto-merge
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
timeout-minutes: 10
steps:
- name: πŸ“₯ Checkout PR
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: πŸ” Analyze Dependabot PR
id: analyze
run: |
echo "πŸ€– Analyzing Dependabot PR..."
# Get PR details
PR_TITLE="${{ github.event.pull_request.title }}"
PR_BODY="${{ github.event.pull_request.body }}"
echo "πŸ“‹ PR Title: $PR_TITLE"
echo "pr_title=$PR_TITLE" >> $GITHUB_OUTPUT
# Determine update type
if echo "$PR_TITLE" | grep -q "Bump.*from.*to"; then
echo "πŸ”„ Standard dependency update detected"
echo "update_type=dependency" >> $GITHUB_OUTPUT
elif echo "$PR_TITLE" | grep -qi "security"; then
echo "πŸ”’ Security update detected"
echo "update_type=security" >> $GITHUB_OUTPUT
else
echo "❓ Unknown update type"
echo "update_type=unknown" >> $GITHUB_OUTPUT
fi
- name: πŸ” Check if CI passed
uses: actions/github-script@v7
id: ci-check
with:
script: |
const { data: checks } = await github.rest.checks.listForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.payload.pull_request.head.sha,
});
// Look for main CI workflow
const ciChecks = checks.check_runs.filter(check =>
check.name.includes('Quality Gate') ||
check.name.includes('Code Quality')
);
const allPassed = ciChecks.every(check => check.status === 'completed' && check.conclusion === 'success');
const anyFailed = ciChecks.some(check => check.conclusion === 'failure');
if (anyFailed) {
console.log('❌ Some CI checks failed');
core.setOutput('ci_status', 'failed');
} else if (allPassed && ciChecks.length > 0) {
console.log('βœ… All CI checks passed');
core.setOutput('ci_status', 'passed');
} else {
console.log('⏳ CI checks still running or not found');
core.setOutput('ci_status', 'pending');
}
- name: 🎯 Auto-merge Decision
id: decision
run: |
CI_STATUS="${{ steps.ci-check.outputs.ci_status }}"
UPDATE_TYPE="${{ steps.analyze.outputs.update_type }}"
echo "🎯 Making auto-merge decision..."
echo " CI Status: $CI_STATUS"
echo " Update Type: $UPDATE_TYPE"
SHOULD_MERGE="false"
# Auto-merge conditions
if [[ "$CI_STATUS" == "passed" ]]; then
if [[ "$UPDATE_TYPE" == "security" ]]; then
echo "πŸ”’ Security update with passing CI - auto-merging"
SHOULD_MERGE="true"
elif [[ "$UPDATE_TYPE" == "dependency" ]]; then
# Check if it's a patch/minor update (safer)
if echo "${{ steps.analyze.outputs.pr_title }}" | grep -E "(patch|minor)" > /dev/null; then
echo "πŸ”„ Patch/minor update with passing CI - auto-merging"
SHOULD_MERGE="true"
else
echo "⚠️ Major update - requires manual review"
SHOULD_MERGE="false"
fi
fi
else
echo "❌ CI not passed - skipping auto-merge"
SHOULD_MERGE="false"
fi
echo "should_merge=$SHOULD_MERGE" >> $GITHUB_OUTPUT
echo "🎯 Decision: Auto-merge = $SHOULD_MERGE"
- name: βœ… Auto-merge Dependabot PR
if: steps.decision.outputs.should_merge == 'true'
uses: actions/github-script@v7
with:
script: |
console.log('βœ… Auto-merging Dependabot PR...');
await github.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
commit_title: `πŸ€– ${context.payload.pull_request.title}`,
commit_message: `Auto-merged by Dependabot workflow\n\n${context.payload.pull_request.body}`,
merge_method: 'squash'
});
console.log('πŸŽ‰ Dependabot PR auto-merged successfully!');
- name: πŸ’¬ Add Review Comment
if: steps.decision.outputs.should_merge == 'false'
uses: actions/github-script@v7
with:
script: |
const ciStatus = '${{ steps.ci-check.outputs.ci_status }}';
const updateType = '${{ steps.analyze.outputs.update_type }}';
let message = '## πŸ€– Dependabot Auto-merge Analysis\n\n';
if (ciStatus === 'failed') {
message += '❌ **CI checks failed** - This PR requires manual review and fixes.\n\n';
} else if (ciStatus === 'pending') {
message += '⏳ **CI checks still running** - Auto-merge will be reconsidered once checks complete.\n\n';
} else if (updateType === 'dependency' && !`${{ steps.analyze.outputs.pr_title }}`.match(/(patch|minor)/)) {
message += '⚠️ **Major version update detected** - This requires manual review for potential breaking changes.\n\n';
} else {
message += 'ℹ️ **Manual review required** - This PR did not meet auto-merge criteria.\n\n';
}
message += '### πŸ“‹ Auto-merge Criteria\n';
message += '- βœ… Security updates with passing CI\n';
message += '- βœ… Patch/minor dependency updates with passing CI\n';
message += '- ❌ Major version updates (require manual review)\n';
message += '- ❌ Any PR with failing CI checks\n\n';
message += '**Note:** Production deployment is automatically skipped for all Dependabot commits for security.';
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: message
});
# ═══════════════════════════════════════════════════════════════════════════════
# πŸ“Š SUMMARY REPORTING
# ═══════════════════════════════════════════════════════════════════════════════
summary:
name: πŸ“Š Dependabot Summary
runs-on: ubuntu-latest
needs: [dependabot-auto-merge]
if: always() && github.actor == 'dependabot[bot]'
steps:
- name: πŸ“Š Generate Summary
run: |
echo "## πŸ€– Dependabot PR Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**PR:** ${{ github.event.pull_request.title }}" >> $GITHUB_STEP_SUMMARY
echo "**Author:** ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ${{ needs.dependabot-auto-merge.result }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.dependabot-auto-merge.result }}" == "success" ]]; then
echo "βœ… **Dependabot PR processed successfully**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### πŸ›‘οΈ Security Note" >> $GITHUB_STEP_SUMMARY
echo "Production deployment is **automatically skipped** for Dependabot commits." >> $GITHUB_STEP_SUMMARY
echo "Use the Manual Deployment workflow if you need to deploy after testing." >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ **Dependabot PR requires attention**" >> $GITHUB_STEP_SUMMARY
fi