diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 41f0e18b..0dfceda4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,22 +1,31 @@ version: 2 +multi-ecosystem-groups: + ci-tooling: + schedule: + interval: monthly + assignees: + - camUrban updates: - package-ecosystem: github-actions directory: / - schedule: - interval: weekly + patterns: + - "*" + multi-ecosystem-group: ci-tooling cooldown: default-days: 7 - groups: - actions: - patterns: - - "*" - package-ecosystem: pre-commit directory: / - schedule: - interval: weekly + patterns: + - "*" + multi-ecosystem-group: ci-tooling cooldown: default-days: 7 - groups: - pre-commit: - patterns: - - "*" + - package-ecosystem: pip + directory: / + schedule: + interval: monthly + open-pull-requests-limit: 0 + labels: + - dependencies + assignees: + - camUrban diff --git a/.github/workflows/dependabot-triage.yml b/.github/workflows/dependabot-triage.yml new file mode 100644 index 00000000..b69812bf --- /dev/null +++ b/.github/workflows/dependabot-triage.yml @@ -0,0 +1,47 @@ +name: dependabot-triage + +on: + pull_request: + types: [opened, reopened, synchronize] + +permissions: {} + +jobs: + dependabot-triage: + if: github.event.pull_request.user.login == 'dependabot[bot]' + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - name: Shorten the pull request title + env: + GH_TOKEN: ${{ github.token }} + PR_URL: ${{ github.event.pull_request.html_url }} + run: | + non_ci_files=$(gh pr view "$PR_URL" --json files --jq '[.files[].path | select(startswith(".github/") or . == ".pre-commit-config.yaml" | not)] | length') + if [ "$non_ci_files" -eq 0 ]; then + title="Bump CI tooling" + else + dependency_count=$(gh pr view "$PR_URL" --json commits --jq '[.commits[] | select(any(.authors[]; .login == "dependabot[bot]")) | .messageBody | split("\n")[] | select(startswith("- dependency-name: "))] | unique | length') + if [ "$dependency_count" -eq 1 ]; then + title="Bump runtime dependency" + else + title="Bump runtime dependencies" + fi + fi + gh pr edit "$PR_URL" --title "$title" + - name: Set the milestone to the lowest open release + env: + GH_TOKEN: ${{ github.token }} + PR_URL: ${{ github.event.pull_request.html_url }} + REPO: ${{ github.repository }} + run: | + has_milestone=$(gh pr view "$PR_URL" --json milestone --jq '.milestone != null') + if [ "$has_milestone" = "true" ]; then + exit 0 + fi + milestone=$(gh api "repos/$REPO/milestones?state=open&per_page=100" --jq '[.[].title | select(test("^v[0-9]+\\.[0-9]+\\.[0-9]+$"))] | sort_by(ltrimstr("v") | split(".") | map(tonumber)) | first // empty') + if [ -n "$milestone" ]; then + gh pr edit "$PR_URL" --milestone "$milestone" + fi diff --git a/CLAUDE.md b/CLAUDE.md index e093acc0..c364150d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -34,7 +34,7 @@ Requires Python 3.11, but active development is done in 3.14 ### Relevant Directories, Packages, and Files -- `.github/`: Directory with GitHub configuration files: the issue and pull request templates, the label definitions (`labels.yml`), the Dependabot, funding, and code-owner configuration, and the GitHub Actions workflows (`ascii-only.yml`, `ci.yml`, `label-sync.yml`, `pre-commit-hooks.yml`, `private-access.yml`, `publish.yml`, and `zizmor.yml`) +- `.github/`: Directory with GitHub configuration files: the issue and pull request templates, the label definitions (`labels.yml`), the Dependabot, funding, and code-owner configuration, and the GitHub Actions workflows (`ascii-only.yml`, `ci.yml`, `dependabot-triage.yml`, `label-sync.yml`, `pre-commit-hooks.yml`, `private-access.yml`, `publish.yml`, and `zizmor.yml`) - `.venv/`: Directory for the Python virtual environment, configured for the host machine's OS (not included in version control) - `.venv-wsl/`: Directory for the Python virtual environment configured for a WSL OS (not included in version control, may be missing if host machine doesn't use WSL for development) - `experimental/`: Directory with experimental scripts and prototypes (not included in version control)