Skip to content

Commit 49cb700

Browse files
committed
Support semver suffixes
1 parent 8899a7e commit 49cb700

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/automerge.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: "Dependabot auto-merge"
33
on: pull_request
44

55
permissions:
6+
actions: write
67
contents: write
78
pull-requests: write
89

@@ -21,11 +22,14 @@ jobs:
2122
# Checking the PR title is a poor substitute for the actual PR changes
2223
# but as long as this is used only with dependabot PRs,
2324
# it should be safe to assume that the title is not misleading.
24-
regexp='^Bump .* from [0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)? to [0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?( in .*)?$'
25-
if [[ "${PR_TITLE}" =~ $regexp ]]; then
26-
gh pr review --approve "${PR_URL}"
25+
regexp='^Bump .* from [0-9]+\.[0-9]+(\.[0-9]+)?(\.[0-9]+)?(\-[a-z]+)? to [0-9]+\.[0-9]+(\.[0-9]+)?(\.[0-9]+)?(\-[a-z]+)?( in .*)?$'
26+
if ! [[ "${PR_TITLE}" =~ ${regexp} ]] ; then
27+
echo 'Non-semver upgrade, needs manual review.'
28+
elif [ "${BASH_REMATCH[3]}" != "${BASH_REMATCH[6]}" ] ; then
29+
echo 'Version suffixes do not match, needs manual review.'
2730
else
28-
echo 'Non-semver upgrade needs manual review'
31+
echo 'Automated review approval.'
32+
gh pr review --approve "${PR_URL}"
2933
fi
3034
gh pr merge --auto --squash "${PR_URL}"
3135
env:

0 commit comments

Comments
 (0)