Skip to content

Commit 2bcafff

Browse files
Add job opening PRs to bump the coursier version (#1207)
Co-authored-by: GPT-5.6-sol Codex <noreply@openai.com>
1 parent 8a827d3 commit 2bcafff

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Update Coursier
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '17 3 * * *'
7+
timezone: Europe/Paris
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
update-coursier:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v7
18+
19+
- name: Get latest Coursier release
20+
id: coursier
21+
env:
22+
GH_TOKEN: ${{ github.token }}
23+
shell: bash
24+
run: |
25+
version=$(
26+
gh api 'repos/coursier/coursier/releases?per_page=100' \
27+
--jq 'map(select(.draft | not))[0].tag_name'
28+
)
29+
version=${version#v}
30+
if [[ ! "$version" =~ ^[0-9]+(\.[0-9]+)+([.-][0-9A-Za-z.-]+)?$ ]]; then
31+
echo "::error::Unexpected Coursier release version: $version"
32+
exit 1
33+
fi
34+
echo "version=$version" >> "$GITHUB_OUTPUT"
35+
36+
- name: Update default Coursier version
37+
env:
38+
VERSION: ${{ steps.coursier.outputs.version }}
39+
shell: bash
40+
run: |
41+
sed -i -E \
42+
"s/^const defaultVersion = '[^']+'$/const defaultVersion = '$VERSION'/" \
43+
src/main.ts
44+
45+
- name: Create pull request
46+
uses: peter-evans/create-pull-request@v8
47+
with:
48+
branch: update-coursier
49+
delete-branch: true
50+
commit-message: Update Coursier to ${{ steps.coursier.outputs.version }}
51+
title: Update Coursier to ${{ steps.coursier.outputs.version }}
52+
body: |
53+
Updates the default Coursier version to `${{ steps.coursier.outputs.version }}`.
54+
55+
This includes prerelease versions published by coursier/coursier.

0 commit comments

Comments
 (0)