Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/auto-dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Auto-merge Dependabot PR

on:
pull_request:
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

This workflow is triggered on pull_request, but Dependabot-triggered workflows do not receive repository secrets. As a result, secrets.FREQUENZ_AUTO_DEPENDABOT_APP_* will be unavailable and the GitHub App token generation step will fail. Use pull_request_target (and keep the workflow from checking out/running PR code) so secrets are accessible in the base repo context, similar to .github/workflows/labeler.yml.

Suggested change
pull_request:
pull_request_target:
types:
- opened
- synchronize
- reopened

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually a fair point, and I think we need to use pull_request_target in here as suggested. This workflow is not checking-out code, so it should be safe to use pull_request_target as we do in the labeler workflow as copilot suggests. I will submit a fix.


permissions:
contents: read
pull-requests: write

jobs:
auto-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-slim
Comment thread
llucax marked this conversation as resolved.
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_ID }}
private-key: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_PRIVATE_KEY }}

- name: Auto-merge Dependabot PR
uses: frequenz-floss/dependabot-auto-approve@3cad5f42e79296505473325ac6636be897c8b8a1 # v1.3.2
with:
github-token: ${{ steps.app-token.outputs.token }}
dependency-type: 'all'
auto-merge: 'true'
merge-method: 'merge'
add-label: 'tool:auto-merged'