Skip to content

Commit 119490d

Browse files
committed
chore: Add CI job to update dependencies
1 parent a5cda56 commit 119490d

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/deno-lock.yml

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

0 commit comments

Comments
 (0)