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
30 changes: 29 additions & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,39 @@ jobs:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

# Structured info about the update (crate names, group, semver bump).
# `dependency-names` lists every crate the PR touches — including for
# grouped PRs whose titles ("bump the oxc group") don't name the crates.
- name: Fetch Dependabot metadata
id: meta
uses: dependabot/fetch-metadata@v3
Comment thread
tinovyatkin marked this conversation as resolved.

- name: Approve and enable auto-merge
run: |
set -euo pipefail
gh pr review "$PR_NUMBER" --repo "$REPO" --approve --body "Dependabot PR — auto-approved."
gh pr merge "$PR_NUMBER" --repo "$REPO" --auto --squash

# Parser/grammar dependency bumps are relabeled from the hidden
# `build(deps)` type to the custom `deps:` type, which
# release-please surfaces under "Parser & Grammar Updates" (see
# release-please-config.json). Every other dependency bump keeps
# `build(deps)` and stays out of the changelog. release-please
# matches on commit TYPE only (it has no scope filter), so the
# discrimination must be baked into the squashed subject here.
#
# We match on crate-name prefix rather than the PR title so grouped
# PRs are classified correctly. release-please links a changelog
# entry via the trailing "(#NN)", and a custom --subject replaces
# GitHub's default subject entirely, so we re-add it by hand.
if printf '%s' "$NAMES" | grep -qiE '(^|,)[[:space:]]*(tree-sitter|oxc_|mago-|ruff_|sqruff-|pulldown-cmark|ra_ap_|antlr-rust-runtime)'; then
gh pr merge "$PR_NUMBER" --repo "$REPO" --auto --squash \
--subject "deps: ${TITLE#*: } (#${PR_NUMBER})"
else
gh pr merge "$PR_NUMBER" --repo "$REPO" --auto --squash
fi
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
NAMES: ${{ steps.meta.outputs.dependency-names }}
TITLE: ${{ github.event.pull_request.title }}
46 changes: 5 additions & 41 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@
"prerelease": false,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"changelog-types": [
{
"type": "chore",
"scope": "deps",
"section": "Dependencies",
"hidden": false
},
"changelog-sections": [
{
"type": "feat",
"section": "Features",
Expand All @@ -33,43 +27,13 @@
"hidden": false
},
{
"type": "revert",
"section": "Reverts",
"type": "deps",
"section": "Parser & Grammar Updates",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "style",
"section": "Styles",
"hidden": false
},
{
"type": "chore",
"section": "Miscellaneous",
"hidden": false
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": false
},
{
"type": "test",
"section": "Tests",
"hidden": false
},
{
"type": "build",
"section": "Build System",
"hidden": false
},
{
"type": "ci",
"section": "Continuous Integration",
"type": "revert",
"section": "Reverts",
"hidden": false
}
],
Expand Down
Loading