Synchonize OpenCV version #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |