ci: implement toolkit updater workflow #3
Workflow file for this run
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: Update Versions | |
on: | |
schedule: | |
- cron: '0 0 * * 1' # Run every Monday at midnight | |
workflow_dispatch: | |
# Just for test, todo: remove and only run schedule | |
pull_request: | |
branches: ['main'] | |
jobs: | |
update-versions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r script_requirements.txt # Dependencies for python script under 'scripts' | |
- name: Get Latest Version | |
run: python scripts/check_latest_version.py "./toolkit_info.json" | |
- name: Update Version | |
run: python scripts/update_latest_version.py "./toolkit_info.json" "./Dockerfile" "./README.md" | |
- name: Commit and Push Changes | |
run: | | |
git config --global user.email "actions@github.com" | |
git config --global user.name "GitHub Actions" | |
git add . | |
git diff --quiet && git diff --staged --quiet | |
# git commit -m "core: update tool versions" | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'core: Update tool versions' | |
committer: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>' | |
author: '${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>' | |
signoff: false | |
delete-branch: true | |
title: 'core: Update tool versions' | |
body: | | |
core: update tool versions | |
- Updated latest tool versions with *today's* date | |
- Auto-generated by [create-pull-request][1] | |
[1]: https://github.com/peter-evans/create-pull-request | |
labels: 'upgrade, automated pr, core' |