Skip to content

Commit 1be271c

Browse files
committed
dependabot
1 parent fd0b003 commit 1be271c

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "maven"
9+
directory: "/dependabot"
10+
schedule:
11+
interval: "weekly"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ jobs:
4242
uses: DeLaGuardo/setup-clojure@master
4343
with:
4444
lein: latest
45+
- name: Setup Babashka
46+
run: bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
47+
- name: Check dependabot is in sync with project.clj
48+
run: ./script/check-dependabot
4549
- name: Run tests
4650
run: lein do clean, all test, all check
4751
deploy:

scripts/check-dependabot

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# Check that project.clj is in sync with the committed dependabot pom.xml.
3+
4+
set -e
5+
6+
./script/sync-dependabot
7+
set +e
8+
if git diff --ignore-all-space --exit-code dependabot/pom.xml ; then
9+
echo 'project.clj and dependabot/pom.xml are in sync.'
10+
exit 0
11+
else
12+
echo
13+
echo 'project.clj and dependabot/pom.xml are out of sync! Please run ./script/sync-dependabot locally and commit the results.'
14+
echo 'If this is a PR from dependabot, you must manually update the version in project.clj'
15+
exit 1
16+
fi

scripts/sync-dependabot

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SHA=$(git rev-parse HEAD)
6+
7+
lein pom
8+
mkdir -p dependabot
9+
mv pom.xml dependabot
10+
# lein pom uses the origin git remote to add metadata. remove for reproducibility.
11+
bb '(spit "dependabot/pom.xml" (-> "dependabot/pom.xml" slurp xml/parse-str (update :content (partial remove #(some-> % :tag name #{"scm" "url"}))) xml/emit-str))'

0 commit comments

Comments
 (0)