Skip to content

Commit ae9cdcc

Browse files
committed
ci: update patch file names for Dependabot merge
1 parent 57803ba commit ae9cdcc

File tree

4 files changed

+554
-244
lines changed

4 files changed

+554
-244
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
version: 2
2+
23
updates:
34
- package-ecosystem: npm
45
directory: '/'

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,31 @@ jobs:
3939
steps:
4040
- name: Checkout
4141
uses: actions/checkout@v5
42+
- name: Rename patch-package files to match updated versions
43+
shell: bash
44+
run: |
45+
get_version() {
46+
jq -r ".dependencies[\"$1\"] // .devDependencies[\"$1\"]" package.json
47+
}
48+
49+
for PATCH in patches/*.patch; do
50+
BASE=$(basename "$PATCH" .patch)
51+
52+
# Convert patch filename back to package name
53+
PACKAGE=$(echo "$BASE" | sed 's|+|/|g')
54+
55+
VERSION=$(get_version "$PACKAGE")
56+
if [ "$VERSION" == "null" ]; then
57+
echo "Skipping $PACKAGE — not found in package.json"
58+
continue
59+
fi
60+
61+
NEW_NAME=$(echo "$PACKAGE" | sed 's|/|+|g')"+${VERSION}.patch"
62+
if [ "$BASE.patch" != "$NEW_NAME" ]; then
63+
echo "Renaming $BASE.patch -> $NEW_NAME"
64+
git mv "$PATCH" "patches/$NEW_NAME"
65+
fi
66+
done
4267
- name: Automerge Dependabot PRs if all checks have passed
4368
shell: bash
4469
env:

0 commit comments

Comments
 (0)