Skip to content

Commit 0dcd33b

Browse files
committed
chore: Add CI job to update dependencies
1 parent a5cda56 commit 0dcd33b

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/deno-lock.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Update dependencies
2+
3+
on:
4+
branch:
5+
- ci/update-deps
6+
schedule:
7+
- cron: "15 15 1-7,15-21 * 1"
8+
- cron: "15 16 1-7 * 2"
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
update:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
steps:
21+
- name: Checkout pull request
22+
uses: actions/checkout@v5
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
- uses: denoland/setup-deno@v2
26+
with:
27+
deno-version: v2.x
28+
- name: Set compatible update
29+
if: github.event.schedule != '15 16 1-7 * 2'
30+
run: echo UPDATE_TYPE=compatible >> $GITHUB_ENV
31+
- name: Set latest update
32+
if: github.event.schedule == '15 16 1-7 * 2'
33+
run: echo UPDATE_TYPE=latest >> $GITHUB_ENV
34+
- name: Set git identity
35+
run: |
36+
git config --global user.name "bids[bot]"
37+
git config --global user.email "[email protected]"
38+
- name: Install the latest version of uv
39+
uses: astral-sh/setup-uv@v7
40+
- name: Update all dependencies with 14 day cooldown
41+
run: >
42+
uvx datalad run -i deno.json -i deno.lock -o deno.json -o deno.lock --
43+
deno update --$UPDATE_TYPE --minimum-dependency-age $MIN_AGE
44+
env:
45+
# Two weeks, in minutes
46+
MIN_AGE: 20160
47+
- name: Update @bids/schema
48+
run: >
49+
uvx datalad run -i deno.json -i deno.lock -o deno.json -o deno.lock --
50+
deno update --$UPDATE_TYPE @bids/schema
51+
- name: Check for changes
52+
id: check
53+
run: |
54+
if [[ "$REF" != "$( git rev-parse HEAD )" ]]; then
55+
echo "changes=1" >> $GITHUB_OUTPUT
56+
fi
57+
env:
58+
REF: ${{ github.event.pull_request.head.sha }}
59+
- name: Push updated branch, if needed
60+
if: steps.check.changes
61+
run: git push -f origin HEAD:deps/$UPDATE_TYPE

0 commit comments

Comments
 (0)