forked from yeatse/opencv-spm
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 949 Bytes
/
watch.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
name: Synchonize OpenCV version
on:
schedule:
- cron: '6 3 * * *'
workflow_dispatch:
jobs:
synchronize:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PUSH_TO_OPENCV_SPM }}
- name: Fetch OpenCV latest version
run: |
curl -s https://api.github.com/repos/opencv/opencv/releases/latest | jq -r '.tag_name' > .version
- name: Commit changes
run: |
if [[ "$(cat .version)" == "null" ]]; then
echo "version is null"
exit 1
fi
if [[ -n $(git status --porcelain) ]]; then
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions"
git add .version
git commit -m "Update OpenCV version to $(cat .version)"
git push
fi