Skip to content

Add auto-merge for my commits (just testing)#28

Merged
joselsegura merged 1 commit intoRedHatInsights:masterfrom
joselsegura:add_autoupdate_reviews
Mar 24, 2026
Merged

Add auto-merge for my commits (just testing)#28
joselsegura merged 1 commit intoRedHatInsights:masterfrom
joselsegura:add_autoupdate_reviews

Conversation

@joselsegura
Copy link
Contributor

Description

In order to test the posibilities we have using CODEOWNERS file, I need an auto approve/auto merge CI to be run.

I modified the one for bots in order to auto-approve a PR made by me

Type of change

  • Configuration update

Testing steps

@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 49b3e970-07bc-4217-b464-f4aef8344230

📥 Commits

Reviewing files that changed from the base of the PR and between d94ac11 and ea17a08.

📒 Files selected for processing (1)
  • .github/workflows/bots-automerge.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/bots-automerge.yaml

Summary by CodeRabbit

  • Chores
    • Added an automated workflow that approves and auto-merges qualifying bot-generated pull requests. It runs on new pull requests from authorized automation, performs approval steps and enables auto-merge, streamlining processing of dependency and infra updates, reducing manual steps, and allowing maintainers to focus on critical reviews while preserving project stability.

Walkthrough

Adds a GitHub Actions workflow that triggers on pull_request events and, when the PR author is joselsegura, runs three gh CLI steps: approve with GITHUB_TOKEN, approve with secrets.INSIGHTSDROID_TOKEN, and enable auto-merge for the PR.

Changes

Cohort / File(s) Summary
Bot Auto-merge Workflow
.github/workflows/bots-automerge.yaml
New workflow triggered on pull_request. Job-level if checks PR author (github.event.pull_request.user.login == 'joselsegura'). Job runs: gh pr review --approve with github.token, gh pr review --approve with secrets.INSIGHTSDROID_TOKEN, then gh pr merge --auto --merge against github.event.pull_request.html_url. Permissions set: contents: write, pull-requests: write.

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as "GitHub Actions\nWorkflow"
  participant Runner as "Actions\nRunner\n(ubuntu-latest)"
  participant GH as "GitHub\n(Events / PR API)"

  Workflow->>GH: Receive pull_request event
  Workflow->>Runner: Start job (if author == joselsegura)
  Runner->>GH: Read PR metadata (author, html_url)
  alt author == joselsegura
    Runner->>GH: gh pr review --approve (using GITHUB_TOKEN)
    Runner->>GH: gh pr review --approve (using INSIGHTSDROID_TOKEN)
    Runner->>GH: gh pr merge --auto --merge (enable auto-merge)
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an auto-merge workflow for commits by the PR author, though the parenthetical note suggests this is experimental.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of the workflow addition and the testing context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/bots-automerge.yaml (1)

3-3: Specify event types to avoid redundant workflow runs.

Without specifying event types, this workflow triggers on opened, synchronize, and reopened. This means every push to the PR branch re-runs the approval and merge steps. Consider restricting to opened only.

Suggested fix
-on: pull_request
+on:
+  pull_request:
+    types: [opened]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/bots-automerge.yaml at line 3, The workflow currently
triggers on all pull_request activity via the "on: pull_request" declaration
which causes redundant runs; update the workflow trigger to restrict event types
by replacing the generic "on: pull_request" with a typed trigger (e.g., "on:
pull_request: types: [opened]") so the jobs only run when a PR is opened; ensure
the "on" block in the workflow file is updated accordingly and validate the YAML
indentation/format to keep the rest of the workflow (approval/merge jobs)
intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/bots-automerge.yaml:
- Around line 25-29: The "InsightsDroid approves the PR" step currently attempts
to have InsightsDroid approve its own PR which GitHub forbids; update that job
step (named "InsightsDroid approves the PR") to either add continue-on-error:
true so the workflow proceeds if the approval fails, or guard the step with a
conditional that skips it when the PR author/actor equals "InsightsDroid" (use
the github.actor or github.event.pull_request.user.login context) while still
keeping the existing run and env entries (PR_URL and GH_TOKEN) intact.

---

Nitpick comments:
In @.github/workflows/bots-automerge.yaml:
- Line 3: The workflow currently triggers on all pull_request activity via the
"on: pull_request" declaration which causes redundant runs; update the workflow
trigger to restrict event types by replacing the generic "on: pull_request" with
a typed trigger (e.g., "on: pull_request: types: [opened]") so the jobs only run
when a PR is opened; ensure the "on" block in the workflow file is updated
accordingly and validate the YAML indentation/format to keep the rest of the
workflow (approval/merge jobs) intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e89d91bc-722b-474f-bf55-d9617295707d

📥 Commits

Reviewing files that changed from the base of the PR and between f58ef58 and 42a29db.

📒 Files selected for processing (1)
  • .github/workflows/bots-automerge.yaml

JiriPapousek
JiriPapousek previously approved these changes Mar 24, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/bots-automerge.yaml:
- Around line 14-18: The GitHub Actions expression under the if: block in
bots-automerge.yaml is invalid because the block scalar (|) treats lines with #
as literal text and the expression parser rejects # characters; fix by replacing
the multi-line literal with a single valid expression (e.g.,
github.event.pull_request.user.login == 'joselsegura') or by removing the
commented lines inside the block and, if you need notes, move them to proper
YAML comments above the if: key (so edit the if: expression content to contain
only a valid GitHub Actions boolean expression and remove or relocate the lines
starting with #).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3574a770-4599-4ac0-b79a-9902fbd5bc2c

📥 Commits

Reviewing files that changed from the base of the PR and between 42a29db and d94ac11.

📒 Files selected for processing (1)
  • .github/workflows/bots-automerge.yaml

@joselsegura joselsegura force-pushed the add_autoupdate_reviews branch from d94ac11 to ea17a08 Compare March 24, 2026 09:12
@joselsegura joselsegura merged commit a7eb71f into RedHatInsights:master Mar 24, 2026
1 of 2 checks passed
@joselsegura joselsegura deleted the add_autoupdate_reviews branch March 24, 2026 09:31
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.

3 participants