Skip to content

PYTHON-5887 Add a pre-commit autoupdate action with a release cooldown - #136

Draft
aclark4life wants to merge 1 commit into
mongodb-labs:mainfrom
aclark4life:PYTHON-5887
Draft

PYTHON-5887 Add a pre-commit autoupdate action with a release cooldown#136
aclark4life wants to merge 1 commit into
mongodb-labs:mainfrom
aclark4life:PYTHON-5887

Conversation

@aclark4life

@aclark4life aclark4life commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

PYTHON-5887

Adds a shared pre-commit-autoupdate action so driver repos stay current on hook versions instead of accumulating the kind of large one-off lint bump PYTHON-5858 needed.

Changes in this PR

pre-commit-autoupdate/ (new). Runs pre-commit autoupdate on a schedule and opens a pull request with the hook revision changes, maintaining a single open PR rather than a new one each week.

open-or-update-pr/ (new). python/uv-lock-update/decide_pr_action.sh already implemented "open a new PR or refresh the open one on this branch" generically.

python/uv-lock-update/ (refactored). update_lock.sh no longer shells out to decide_pr_action.sh. It writes changed and body step outputs, and action.yml gates $/open-or-update-pr on changed == 'true'.

Test Plan

  • test_apply_cooldown.sh
  • test_diff_config.sh
  • test_autoupdate.sh
  • test_decide_pr_action.sh

permission-contents: write
permission-pull-requests: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is now the default value. This env var can be removed.
https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/

Comment on lines +7 to +12
app_id:
description: GitHub App ID for authenticated pushes. Required unless dry_run is true.
default: ""
private_key:
description: GitHub App private key for authenticated pushes. Required unless dry_run is true.
default: ""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do you need specific permissions? Isn't it simpler to use the permissions:

permissions:
    contents: write
    pull-requests: write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants