Skip to content

Commit 33173ae

Browse files
committed
chore: Add CI job to update dependencies
1 parent a5cda56 commit 33173ae

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/deno-lock.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
pull-requests: write
22+
steps:
23+
- name: Checkout pull request
24+
uses: actions/checkout@v5
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
- uses: denoland/setup-deno@v2
28+
with:
29+
deno-version: v2.x
30+
- name: Set compatible update
31+
if: github.event.schedule != '15 16 1-7 * 2'
32+
run: echo UPDATE_TYPE=compatible >> $GITHUB_ENV
33+
- name: Set latest update
34+
if: github.event.schedule == '15 16 1-7 * 2'
35+
run: echo UPDATE_TYPE=latest >> $GITHUB_ENV
36+
- name: Set git identity
37+
run: |
38+
git config --global user.name "bids[bot]"
39+
git config --global user.email "[email protected]"
40+
- name: Install the latest version of uv
41+
uses: astral-sh/setup-uv@v7
42+
- name: List updates
43+
run: >
44+
deno outdated |
45+
perl -0 -pe 's/[^[:ascii:]]//g; s/\n\n/\n/g; s/(^|\n) */$1/g' |
46+
uvx tabulate -f github -1 - |
47+
tee /tmp/outdated.md
48+
env:
49+
NO_COLOR: 1
50+
- name: Update dependencies
51+
run: >
52+
uvx datalad run -i deno.json -i deno.lock -o deno.json -o deno.lock --
53+
bash -c
54+
"deno update --$UPDATE_TYPE @bids/schema &&
55+
deno update --$UPDATE_TYPE --minimum-dependency-age $MIN_AGE"
56+
env:
57+
# Two weeks, in minutes
58+
MIN_AGE: 20160
59+
- name: Make pull request
60+
uses: peter-evans/create-pull-request@v7
61+
with:
62+
branch: deps/${{ env.UPDATE_TYPE }}
63+
title: "chore(deps): Update strategy ${{ env.UPDATE_TYPE }}"
64+
body-path: /tmp/outdated.md

0 commit comments

Comments
 (0)