-
Notifications
You must be signed in to change notification settings - Fork 394
29 lines (29 loc) · 1020 Bytes
/
update.yaml
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
name: Update download links
on:
schedule:
- cron: '0 18 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: iterative/setup-cml@v1
- name: Update
id: update
shell: bash
run: |
url=https://api.github.com/repos/iterative/dvc/releases/latest
version=$(curl --silent $url | jq -r .tag_name)
path=src/components/DownloadButton/index.tsx
sed -i "s/^const VERSION = .*$/const VERSION = \`$version\`/g" $path
echo "changes=$(git diff | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "version=$version" >> $GITHUB_OUTPUT
- name: Create PR
if: ${{ steps.update.outputs.changes != '' }}
run: |
cml pr create \
--token="${{ secrets.GITHUB_TOKEN }}" \
--message="dvc ${{ steps.update.outputs.version }}" \
--title="dvc ${{ steps.update.outputs.version }}" . \
--body="Ping @iterative/dvc"