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
44 changes: 42 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,52 @@
version: 2

multi-ecosystem-groups:
infrastructure:
schedule:
interval: "weekly"
day: "wednesday"
open-pull-requests-limit: 25
commit-message:
prefix: "chore"
include: "scope"

updates:
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
open-pull-requests-limit: 25
cooldown:
default-days: 7
commit-message:
prefix: "chore"
include: "scope"
groups:
dotnet:
dotnet-minor-patch:
update-types:
- "minor"
- "patch"
patterns:
- "*"
- "*"
dotnet-major:
update-types:
- "major"
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/"
patterns:
- "*"
multi-ecosystem-group: "infrastructure"
cooldown:
default-days: 7

- package-ecosystem: "uv"
directory: "/"
patterns:
- "*"
multi-ecosystem-group: "infrastructure"
cooldown:
default-days: 7
34 changes: 34 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dependabot auto-merge

on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'LayeredCraft/lambda-aspnetcore-hosting-extensions'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Approve PR
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a token that can trigger push workflows

When this enables auto-merge with secrets.GITHUB_TOKEN, the eventual merge is attributed to the workflow token, and GitHub documents that events triggered by GITHUB_TOKEN do not create new workflow runs except dispatch and selected PR events. In this repo the main Build and Pages deploy jobs are both push-triggered on main, so auto-merged Dependabot updates can land without running those post-merge workflows; use a GitHub App/PAT token for the merge step if those main-branch workflows must run after dependency updates.

Useful? React with 👍 / 👎.

22 changes: 10 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ on:
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'pyproject.toml'
- 'uv.lock'
- '.github/workflows/docs.yml'
pull_request:
branches: [ main ]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'pyproject.toml'
- 'uv.lock'
- '.github/workflows/docs.yml'

permissions:
Expand All @@ -35,28 +39,22 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version-file: pyproject.toml

- name: Cache dependencies
uses: actions/cache@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
key: mkdocs-material-${{ hashFiles('requirements.txt') }}
path: ~/.cache/pip
restore-keys: |
mkdocs-material-
enable-cache: true

- name: Install dependencies
run: |
pip install mkdocs-material
pip install mkdocs-minify-plugin
run: uv sync --locked

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- name: Build documentation
run: |
mkdocs build --clean
run: uv run mkdocs build --clean

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
4 changes: 3 additions & 1 deletion LayeredCraft.Lambda.AspNetCore.HostingExtensions.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<Folder Name="/docs/">
<File Path="docs/index.md" />
<File Path="mkdocs.yml" />
<File Path="requirements.txt" />
<File Path="pyproject.toml" />
<File Path="uv.lock" />
</Folder>
<Folder Name="/docs/assets/">
<File Path="docs/assets/icon.png" />
Expand All @@ -23,6 +24,7 @@
</Folder>
<Folder Name="/git/">
<File Path=".github/dependabot.yml" />
<File Path=".github/workflows/dependabot-auto-merge.yml" />
<File Path=".github/workflows/build.yaml" />
<File Path=".github/workflows/docs.yml" />
<File Path=".github/workflows/pr-build.yaml" />
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[project]
name = "lambda-aspnetcore-hosting-extensions-docs"
version = "0.0.0"
description = "Documentation build dependencies for Lambda ASP.NET Core Hosting Extensions."
requires-python = ">=3.12"
dependencies = [
"mkdocs>=1.5.3",
"mkdocs-material>=9.4.6",
"mkdocs-minify-plugin>=0.7.1",
]
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

Loading
Loading