Skip to content

chore(workflow): change pull_request event to pull_request_target#74

Merged
miroslavpojer merged 1 commit into
masterfrom
feature/fix-auto-merge
Apr 27, 2026
Merged

chore(workflow): change pull_request event to pull_request_target#74
miroslavpojer merged 1 commit into
masterfrom
feature/fix-auto-merge

Conversation

@miroslavpojer

@miroslavpojer miroslavpojer commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Overview

The Dependabot auto-approve and auto-merge workflow was not functioning as intended because it used the pull_request event trigger. Workflows triggered by pull_request on PRs opened by bots (such as Dependabot) run with read-only token permissions and cannot write back to the repository, so the approve and merge steps were silently failing.

This change switches the trigger to pull_request_target, which runs in the context of the base branch and is granted the write permissions declared in the workflow (contents: write, pull-requests: write). This allows the workflow to successfully approve and auto-merge Dependabot PRs once all required status checks and branch protection rules are satisfied.

No logic, merge conditions, or repository guard (github.repository == 'AbsaOSS/version-tag-check') were changed — only the event trigger.

Release Notes

  • Fixed Dependabot auto-approve and auto-merge workflow by switching the trigger from pull_request to pull_request_target, restoring write permissions needed to approve and merge PRs automatically.

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflow configuration for automated dependency management to improve processing of automated pull requests.

… Dependabot auto-merge

Co-authored-by: Copilot <copilot@github.com>
@miroslavpojer miroslavpojer self-assigned this Apr 27, 2026
@miroslavpojer
miroslavpojer merged commit aedefc7 into master Apr 27, 2026
6 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Apr 27, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7b633771-db7e-4408-8228-e8c2402cf285

📥 Commits

Reviewing files that changed from the base of the PR and between 4e836da and 9703706.

📒 Files selected for processing (1)
  • .github/workflows/dependabot.yml

Walkthrough

The GitHub Actions workflow trigger for Dependabot pull requests is changed from pull_request to pull_request_target, while maintaining event types opened and synchronize. This alters the execution context for auto-approve and auto-merge operations on Dependabot PRs.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Configuration
.github/workflows/dependabot.yml
Changed event trigger from pull_request to pull_request_target for Dependabot PR automation steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

infrastructure

Suggested reviewers

  • tmikula-dev
  • benedeki
  • Zejnilovic

Poem

🐰 A tiny tweak, so small yet wise,
From pull_request to target skies,
Dependabot's dance takes a different turn,
New contexts flow, old patterns burn,
Automation flows in fresh, green clover! 🌿

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix-auto-merge

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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