Skip to content

Add Dependabot auto-merge workflow#131

Open
Copilot wants to merge 2 commits intomainfrom
copilot/implement-similar-functionality
Open

Add Dependabot auto-merge workflow#131
Copilot wants to merge 2 commits intomainfrom
copilot/implement-similar-functionality

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Mirrors the functionality from USTC-KnowledgeComputingLab/ds#318: automatically merge Dependabot PRs once all required status checks pass.

Changes

  • New workflow .github/workflows/dependabot.yml: triggers on pull_request, gates on github.actor == 'dependabot[bot]', and enables GitHub's native auto-merge via gh pr merge --auto --squash — the actual merge only fires after all required checks pass
jobs:
  dependabot:
    runs-on: ubuntu-latest
    if: github.actor == 'dependabot[bot]'
    steps:
      - name: auto-merge
        run: gh pr merge --auto --squash "$PR_URL"
        env:
          PR_URL: ${{ github.event.pull_request.html_url }}
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Requires contents: write and pull-requests: write permissions. Style follows existing workflows in this repo (on: list notation, same job structure).

Agent-Logs-Url: https://github.com/USTC-KnowledgeComputingLab/ddss/sessions/0edc6775-89d5-4b9d-ba2d-aa49a24499ee

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement similar functionality as in PR #318 Add Dependabot auto-merge workflow Apr 9, 2026
Copilot AI requested a review from hzhangxyz April 9, 2026 06:41
@hzhangxyz hzhangxyz marked this pull request as ready for review April 9, 2026 10:53
Copilot AI review requested due to automatic review settings April 9, 2026 10:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions workflow to automatically enable GitHub native auto-merge for Dependabot PRs, so those PRs merge automatically once all required checks pass.

Changes:

  • Introduces .github/workflows/dependabot.yml to run on pull_request events.
  • Gates the job to Dependabot activity and enables auto-merge via gh pr merge --auto --squash.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The job condition uses github.actor == 'dependabot[bot]', which will stop enabling auto-merge if a non-Dependabot user triggers a pull_request event on a Dependabot PR (e.g., via “Update branch”/rebases that generate a new synchronize event). Consider gating on the PR author instead (e.g., github.event.pull_request.user.login) so the workflow consistently applies to Dependabot-authored PRs regardless of who triggered the latest event.

Suggested change
if: github.actor == 'dependabot[bot]'
if: github.event.pull_request.user.login == 'dependabot[bot]'

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,19 @@
name: dependabot
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

Workflow names in this repo appear to be Title Case (e.g., “Docs”, “Jest”, “Pytest”). To match that convention, consider renaming this workflow from dependabot to something like “Dependabot”.

Suggested change
name: dependabot
name: Dependabot

Copilot uses AI. Check for mistakes.
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.

参考 https://github.com/USTC-KnowledgeComputingLab/ds/pull/318 实现相同的功能, 代码风格也不要变化

3 participants