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
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
cooldown:
default-days: 7
schedule:
interval: "weekly"
groups:
Expand All @@ -17,6 +19,8 @@ updates:
# Python
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
cooldown:
default-days: 7
schedule:
interval: "weekly"
groups:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Dependabot auto-merge

# API calls only. Do not check out the PR or run code or artifacts from it.
on:
pull_request_target: # zizmor: ignore[dangerous-triggers] -- no PR code runs with write access.
branches: [develop]
types: [opened, reopened, synchronize, ready_for_review]

permissions: {}

jobs:
automerge:
if: >-
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.event.pull_request.head.repo.full_name == github.repository &&
!github.event.pull_request.draft &&
vars.DEPENDABOT_AUTOMERGE == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
steps:
- name: Enable auto-merge for signed Dependabot commits
run: |
commits=$(gh api --paginate --slurp "repos/$GITHUB_REPOSITORY/pulls/$PR/commits?per_page=100")
if ! jq -e --arg head "$HEAD_SHA" 'flatten | length > 0 and last.sha == $head and
all(.[]; .author.login == "dependabot[bot]" and .commit.verification.verified == true)' \
<<< "$commits" > /dev/null; then
echo 'Not a verified Dependabot head; leaving this PR for manual review.'
exit 0
fi
gh pr merge "$PR" --repo "$GITHUB_REPOSITORY" --auto --squash --match-head-commit "$HEAD_SHA"
12 changes: 7 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ jobs:
- name: Test
run: bash scripts/test.sh
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
- name: Store coverage files
uses: actions/upload-artifact@v7
with:
name: .coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
name: .coverage.${{ runner.os }}-py${{ matrix.python-version }}
path: coverage
if-no-files-found: error
include-hidden-files: true
Expand Down Expand Up @@ -109,10 +109,12 @@ jobs:
include-hidden-files: true

# https://github.com/marketplace/actions/alls-green#why
check: # This job does nothing and is only used for the branch protection
if: github.event.pull_request.draft == false
check: # Aggregate required status for branch protection, including failed prerequisites.
if: always() && github.event.pull_request.draft == false

needs:
- static_analysis
- test
- coverage-combine

runs-on: ubuntu-latest
Expand Down