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
23 changes: 23 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,29 @@ name: Dependabot auto-merge
# contents: write
# pull-requests: write
# uses: splitleafhq/.github/.github/workflows/dependabot-auto-merge.yml@<sha> # <version>
#
# A merge made with GITHUB_TOKEN starts no workflows, so a repo that deploys on
# push to main runs its deploy from a job that needs this one:
#
# deploy-merged:
# needs: automerge
# if: needs.automerge.outputs.merged == 'true'
# runs-on: ubuntu-latest
# timeout-minutes: 5
# permissions:
# actions: write
# steps:
# - env:
# GH_TOKEN: ${{ github.token }}
# GH_REPO: ${{ github.repository }}
# run: gh workflow run deploy.yml --ref main

on:
workflow_call:
outputs:
merged:
description: "'true' when this run merged the pull request"
value: ${{ jobs.merge.outputs.merged }}

permissions:
contents: read
Expand All @@ -28,11 +48,14 @@ jobs:
permissions:
contents: write
pull-requests: write
outputs:
merged: ${{ steps.merge.outcome == 'success' }}
steps:
- name: Read the update type
id: metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
- name: Merge minor and patch updates
id: merge
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
env:
GH_TOKEN: ${{ github.token }}
Expand Down
2 changes: 1 addition & 1 deletion docs/repo-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Use only GitHub's default labels and labels added by Dependabot.
- Every active repo with workflows or package files has `.github/dependabot.yml`: `github-actions` at `/`, plus one entry per package ecosystem at the folder of its manifest.
- Each entry runs weekly, uses commit prefix `chore` with the scope, and has one group named after the ecosystem for minor and patch updates. Major updates are not grouped.
- Ignore an update only when it can't be taken yet, with a comment saying why and when to remove it.
- Dependabot auto-merge is an `automerge` job in `ci.yml` that calls this repo's shared workflow, [`dependabot-auto-merge.yml`](../.github/workflows/dependabot-auto-merge.yml), pinned to a commit SHA: `uses: splitleafhq/.github/.github/workflows/dependabot-auto-merge.yml@<sha>`. The workflow follows GitHub's documented pattern: it reads the update type with `dependabot/fetch-metadata`, never merges majors, and merges with `gh pr merge --squash --match-head-commit <sha>` so a newer push can't merge untested. The job's `needs:` lists every other job in the workflow, or it merges before they finish; the header of the shared workflow shows the full job.
- Dependabot auto-merge is an `automerge` job in `ci.yml` that calls this repo's shared workflow, [`dependabot-auto-merge.yml`](../.github/workflows/dependabot-auto-merge.yml), pinned to a commit SHA: `uses: splitleafhq/.github/.github/workflows/dependabot-auto-merge.yml@<sha>`. The workflow follows GitHub's documented pattern: it reads the update type with `dependabot/fetch-metadata`, never merges majors, and merges with `gh pr merge --squash --match-head-commit <sha>` so a newer push can't merge untested. The job's `needs:` lists every other job in the workflow, or it merges before they finish; the header of the shared workflow shows the full job. A merge made with `GITHUB_TOKEN` starts no workflows, so a repo that deploys on push to `main` adds a `deploy-merged` job that runs its deploy workflow when the shared workflow's `merged` output is `'true'` (also in the header).

## Exceptions

Expand Down
Loading