Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
0e2e719
Automate bot PR maintenance: weekly grouped updates, skip-news labeli…
tpvasconcelos Jul 24, 2026
43fbf03
Add changelog entry for bot PR automation
tpvasconcelos Jul 24, 2026
c44e18d
Merge branch 'main' into automate-bot-pr-maintenance
tpvasconcelos Jul 25, 2026
a052353
Merge branch 'main' into automate-bot-pr-maintenance
tpvasconcelos Jul 25, 2026
d52675d
Rework bot PR automation: commit changelog entries directly to bot PRs
tpvasconcelos Jul 25, 2026
916d9d5
Rewrite add_changelog_entry.py using markdown-it-py source maps
tpvasconcelos Jul 25, 2026
8cf5e35
Never execute code from PR branches in the bot PR automation
tpvasconcelos Jul 27, 2026
a15c283
Merge remote-tracking branch 'origin/main' into bot-prs-security-hard…
tpvasconcelos Jul 28, 2026
082203e
Require the AUTO_MERGE_PAT secret instead of falling back to GITHUB_T…
tpvasconcelos Jul 28, 2026
5f05a6f
Add bot changelog entries to a sorted '### Dependencies' subsection
tpvasconcelos Jul 28, 2026
bf5c21e
Rename the bot PR workflow to bot-pr-automation.yml
tpvasconcelos Jul 29, 2026
436a5e2
Heal bot PRs that fall behind main, not just conflicted ones
tpvasconcelos Jul 29, 2026
8610dcc
Add an aggregate 'All CI checks passed' job for branch protection
tpvasconcelos Jul 29, 2026
32aae22
Replace the aggregate CI job with a self-maintaining all-checks gate
tpvasconcelos Jul 30, 2026
a071c1e
Adopt the ecosystem-standard CI gate job instead of an API-polling gate
tpvasconcelos Jul 30, 2026
97baa13
Keep the required status checks as config-as-code in the repository
tpvasconcelos Jul 30, 2026
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: 19 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Dependabot configuration
#
# Notes:
# - Updates are grouped into a single weekly PR per ecosystem to reduce
# review noise and avoid changelog merge conflicts between bot PRs.
# - The `skip news` label exempts bot PRs from the changelog check
# (see .github/workflows/check-release-notes.yml). Their changelog
# entries are added in bulk at release time with the help of the
# ./cicd_utils/find-unmentioned-prs.sh script.
# - Bot PRs are auto-merged once approved (see .github/workflows/bot-prs.yml).
#
# References:
# - https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
#
Expand All @@ -8,10 +17,16 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels: [ "github_actions" ]
interval: "weekly"
labels: [ "github_actions", "skip news" ]
groups:
github-actions:
patterns: [ "*" ]
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
labels: [ "dependencies" ]
interval: "weekly"
labels: [ "dependencies", "skip news" ]
groups:
pip:
patterns: [ "*" ]
54 changes: 54 additions & 0 deletions .github/workflows/bot-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Automation for PRs opened by trusted bots (dependabot and pre-commit.ci).
#
# For every bot PR, this workflow:
# 1. Adds the `skip news` label, which exempts the PR from the changelog
# check (dependabot PRs already get it via .github/dependabot.yml).
# The corresponding changelog entries are added in bulk at release
# time with the help of ./cicd_utils/find-unmentioned-prs.sh
# 2. Enables GitHub's native auto-merge (squash). The PR will then merge
# automatically as soon as the branch protection requirements are met
# (i.e., an approving review plus all required status checks passing).
#
# The only human action left is the review itself.
#
# Note: If auto-merge is enabled with the default GITHUB_TOKEN, the resulting
# merge commit will not trigger other workflows (e.g., the CI run on main or
# the TestPyPI publish). To get those post-merge runs, create a fine-grained
# PAT with contents:write and pull-requests:write scoped to this repository
# and store it as the AUTO_MERGE_PAT secret. This workflow falls back to
# GITHUB_TOKEN when the secret is not set.
#
# Security: this workflow runs on pull_request_target but never checks out
# or executes code from the PR branch.
#
name: Bot PRs

on:
pull_request_target:
types: [ opened, reopened ]

permissions: {}

jobs:
automate:
name: Label and enable auto-merge
if: >-
github.event.pull_request.user.login == 'dependabot[bot]' ||

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 Handle Dependabot with an available write token

When this job is triggered by a Dependabot PR, it matches this condition, but GitHub treats Dependabot-triggered pull_request_target runs whose PR user is dependabot[bot] as read-only and without Actions secrets (see GitHub's Dependabot-on-Actions restrictions: https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-on-actions#restrictions-when-dependabot-triggers-events). That means AUTO_MERGE_PAT is unavailable and the fallback GITHUB_TOKEN cannot run the later gh pr edit/gh pr merge --auto writes, so weekly Dependabot PRs will fail this workflow instead of getting auto-merge enabled.

Useful? React with 👍 / 👎.

github.event.pull_request.user.login == 'pre-commit-ci[bot]'
runs-on: ubuntu-latest
timeout-minutes: 2
permissions:
contents: write
pull-requests: write
steps:
- name: Add 'skip news' label
run: gh pr edit "$PR_URL" --add-label 'skip news'
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge (squash)
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.AUTO_MERGE_PAT || secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions cicd_utils/find-unmentioned-prs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ else
echo "📋 PRs not mentioned in changelog (${#unmentioned_prs[@]} total):"
echo

suggested_entries=()
for pr in "${unmentioned_prs[@]}"; do
# Get PR title and URL for better readability
pr_info=$(gh pr view "$pr" --json title,url --jq '{title: .title, url: .url}')
Expand All @@ -77,5 +78,13 @@ else
echo " #$pr: $pr_title"
echo " $pr_url"
echo

suggested_entries+=("- ${pr_title} ({gh-pr}\`${pr}\`)")
done

echo "📝 Suggested changelog entries (review and paste under 'Unreleased changes'):"
echo
for entry in "${suggested_entries[@]}"; do
echo "$entry"
done
fi
2 changes: 1 addition & 1 deletion docs/development/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
You need to have push-access to the project's repository to make releases. Therefore, the following release steps are intended to be used as a reference for maintainers or [collaborators](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-user-account-settings/permission-levels-for-a-personal-account-repository#collaborator-access-for-a-repository-owned-by-a-personal-account) with push-access to the repository.
:::

1. Review the **`## Unreleased changes`** section at the top of the {repo-file}`docs/reference/changelog.md` file and, if necessary, group and/or split entries into relevant subsections (e.g., _Features_, _Docs_, _Bugfixes_, _Security_, etc.). Take a look at previous release notes for guidance and try to keep the format consistent. You can also use the `./cicd_utils/find-unmentioned-prs.sh` helper script to find merged PRs that were not mentioned in the changelog yet.
1. Review the **`## Unreleased changes`** section at the top of the {repo-file}`docs/reference/changelog.md` file and, if necessary, group and/or split entries into relevant subsections (e.g., _Features_, _Docs_, _Bugfixes_, _Security_, etc.). Take a look at previous release notes for guidance and try to keep the format consistent. You can also use the `./cicd_utils/find-unmentioned-prs.sh` helper script to find merged PRs that were not mentioned in the changelog yet. Note that PRs opened by trusted bots (e.g., dependabot and pre-commit.ci) are automatically labeled with `skip news` and auto-merged once approved (see {repo-file}`.github/workflows/bot-prs.yml`), so their changelog entries are intentionally deferred to this step: the helper script prints ready-to-paste entries for them (these typically belong under a _CI/CD_ subsection).
2. [Review](https://github.com/tpvasconcelos/ridgeplot/compare) new usages of `.. versionadded::`, `.. versionchanged::`, and `.. deprecated::` directives that were added to the documentation since the last release. If necessary, update the version numbers in these directives to reflect the new release version.
* You can determine the latest release version by running `git describe --tags --abbrev=0` on the `main` branch. Based on this, you can determine the next release version by incrementing the relevant _MAJOR_, _MINOR_, or _PATCH_ numbers.
3. **IMPORTANT:** Remember to switch to the `main` branch and pull the latest changes before proceeding.
Expand Down
Loading