Skip to content

Auto-approve and merge Dependabot PRs as codacybeta - #353

Open
nfcodacy wants to merge 1 commit into
masterfrom
dependabot-auto-merge-codacybeta
Open

nfcodacy wants to merge 1 commit into
masterfrom
dependabot-auto-merge-codacybeta

Conversation

@nfcodacy

Copy link
Copy Markdown

Dependabot PRs here are never merged on their own. The current auto-merge.yml (ahmadnassri action with GITHUB_TOKEN) leaves a github-actions approval, which doesn't count toward the ruleset's required review, so every PR waits for a person (e.g. #350).

This PR replaces it with the workflow that codacy-trivy and quality-integrations-jira already use:

  • If a Dependabot PR is a minor or patch update, codacybeta (via the org secret AUTO_MERGE_TOKEN) approves it and enables squash auto-merge.
  • The merge still waits for the required ci/circleci: plugins_test check.
  • Major updates are no longer auto-merged; they stay open for review, as in the other repos.

No setup needed: AUTO_MERGE_TOKEN already reaches this repo, and auto-merge is already enabled on it.

  • After merge: check that the next Dependabot PR is approved by codacybeta and merges once CI passes

🤖 Generated with Claude Code

Replace the ahmadnassri auto-merge action with the workflow used in
codacy-trivy and quality-integrations-jira: codacybeta (AUTO_MERGE_TOKEN)
approves minor/patch Dependabot PRs and enables squash auto-merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

⚠️ Resolve issues before merging

The workflow may fail to approve or merge Dependabot pull requests because the configured token may be unavailable in Dependabot-triggered workflows. The token must use a supported Dependabot-accessible configuration or authentication mechanism before the intended automation can work.

Test suggestions

  • A Dependabot patch update is approved and configured for squash auto-merge.
  • A Dependabot minor update is approved and configured for squash auto-merge.
  • A major Dependabot update is not approved or auto-merged.
  • Auto-merge remains pending until the required CI check succeeds.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. A Dependabot patch update is approved and configured for squash auto-merge.
2. A Dependabot minor update is approved and configured for squash auto-merge.
3. A major Dependabot update is not approved or auto-merged.
4. Auto-merge remains pending until the required CI check succeeds.

TIP Add review instructions in .codacy/instructions/review.md, or an AGENTS.md, so the reviewer knows your conventions.
TIP How was this review? Give us feedback

id: metadata
uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2
with:
github-token: ${{ secrets.AUTO_MERGE_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

The requested approval and merge behavior will not occur if AUTO_MERGE_TOKEN is an ordinary organization secret, because secrets are restricted for Dependabot-triggered workflows; configure it as a Dependabot-available secret or use an appropriately supported trigger and token mechanism.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant