Skip to content

chore(deps): truncate Dependabot PR bodies to the Signed-off-by line only and skip the remainder#1120

Merged
jenstroeger merged 1 commit into
mainfrom
automerge-dependabot-3
Apr 8, 2026
Merged

chore(deps): truncate Dependabot PR bodies to the Signed-off-by line only and skip the remainder#1120
jenstroeger merged 1 commit into
mainfrom
automerge-dependabot-3

Conversation

@jenstroeger
Copy link
Copy Markdown
Owner

Assuming we have at least one commit in a Dependabot PR then we grab that one/first commit:

> gh pr view 1116 --json commits
{
  "commits": [
    {
      "authoredDate": "2026-04-08T05:11:37Z",
      "authors": [
        {
          "email": "49699333+dependabot[bot]@users.noreply.github.com",
          "id": "MDM6Qm90NDk2OTkzMzM=",
          "login": "dependabot[bot]",
          "name": "dependabot[bot]"
        }
      ],
      "committedDate": "2026-04-08T05:11:37Z",
      "messageBody": "Bumps [pytest-env](https://github.com/pytest-dev/pytest-env) from 1.2.0 to 1.6.0.\n- [Release notes](https://github.com/pytest-dev/pytest-env/releases)\n- [Commits](https://github.com/pytest-dev/pytest-env/compare/1.2.0...1.6.0)\n\n---\nupdated-dependencies:\n- dependency-name: pytest-env\n  dependency-version: 1.6.0\n  dependency-type: direct:development\n  update-type: version-update:semver-minor\n...\n\nSigned-off-by: dependabot[bot] <support@github.com>",
      "messageHeadline": "chore(deps-dev): bump pytest-env from 1.2.0 to 1.6.0",
      "oid": "bbd0f701e20b7fc6ceab3091fc986a7d25159978"
    }
  ]
}

And from that we can filter out the last line of the commit body:

> gh pr view 1116 --json commits --jq .commits[0].messageBody | grep Signed-off-by
Signed-off-by: dependabot[bot] <support@github.com>

And that line becomes the new body of the squashed & merged PR commit. That’s probably much better to read in a git log than this commit 810123f 🤓

@jenstroeger jenstroeger merged commit 14d6315 into main Apr 8, 2026
18 checks passed
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