-
Notifications
You must be signed in to change notification settings - Fork 6
43 lines (39 loc) · 1.3 KB
/
quetz-version-autoupdate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Quetz version autoupdate
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *"
defaults:
run:
shell: bash -el {0}
jobs:
check_update:
name: Check if newer version exists
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/[email protected]
# We need to checkout with SSH here to have actions run on the PR.
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Update Quetz version
run: |
set -eux
QUETZ_VERSION=$(curl https://api.github.com/repos/mamba-org/quetz/releases/latest -s | jq .tag_name -r)
# The tag name is prefixed with 'v'.
QUETZ_VERSION="${QUETZ_VERSION:1}"
if grep -Fxq "$QUETZ_VERSION" .quetz-server-versions
then
echo "No new version found."
else
echo "New version '$QUETZ_VERSION' found."
echo -e "\n$QUETZ_VERSION" >> .quetz-server-versions
fi
- uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54
with:
commit-message: "Auto-update Quetz version."
title: "Auto-update Quetz version"
body: |
A new version of Quetz was detected.
branch: quetz-server-autoupdate
delete-branch: true