Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
cooldown:
default-days: 7
groups:
Expand All @@ -16,5 +17,6 @@ updates:
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
# Security updates only; routine lock refreshes run in .github/workflows/lock-update.yml
open-pull-requests-limit: 0
28 changes: 28 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# .github/workflows/dependabot-auto-merge.yml
name: Dependabot auto-merge

on: pull_request

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Dependabot auto-merge fails

If the repository uses GitHub's default Dependabot settings, this pull_request workflow receives a read-only GITHUB_TOKEN despite the declared write permissions. For patch and minor updates, gh pr review --approve fails, so the workflow never reaches gh pr merge.

Use pull_request_target for this metadata-only workflow. Keep the Dependabot author check and avoid checking out or running PR code.

Suggested change
on: pull_request
on: pull_request_target


permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Fetch Dependabot metadata
id: meta
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Approve and enable auto-merge for patch and minor updates
if: steps.meta.outputs.update-type == 'version-update:semver-patch' || steps.meta.outputs.update-type == 'version-update:semver-minor'
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --squash "$PR_URL"
6 changes: 4 additions & 2 deletions .github/workflows/lock-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ name: Lock update
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 2' # Every Tuesday at 6am UTC
- cron: '0 6 * * 1' # Every Monday at 6am UTC

permissions:
contents: read
contents: write
pull-requests: write

jobs:
lock-update:
Expand All @@ -22,3 +23,4 @@ jobs:
with:
app-id: ${{ vars.APP_ID }}
app-private-key: ${{ secrets.APP_PRIVATE_KEY }}
auto-merge: "true"
6 changes: 4 additions & 2 deletions .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ name: Pre-commit autoupdate
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9am
- cron: '0 9 * * 3' # Every Wednesday at 9am

permissions:
contents: read
contents: write
pull-requests: write

jobs:
autoupdate:
Expand All @@ -22,3 +23,4 @@ jobs:
with:
app-id: ${{ vars.APP_ID }}
app-private-key: ${{ secrets.APP_PRIVATE_KEY }}
auto-merge: "true"
Loading