Update update_checksums.yml #4
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 checksums | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'compliance/**' | |
- '.github/workflows/update_checksums.yml' | |
- '__init__.py' | |
- 'client.py' | |
- 'lib/__init__.py' | |
- 'lib/client.py' | |
- 'lib/common.py' | |
- 'lib/external/__init__.py' | |
- 'lib/external/ntplib.py' | |
- 'lib/server.py' | |
- 'lib/source_hashes.py' | |
- 'lib/summary.py' | |
- 'lib/time_sync.py' | |
- 'server.py' | |
- 'tests/unit/__init__.py' | |
- 'tests/unit/test_server.py' | |
- 'tests/unit/test_source_hashes.py' | |
jobs: | |
update_checksums: | |
name: Check Python | |
runs-on: "${{ matrix.on }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.9] | |
on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Update the source checksums | |
run: | | |
python3 compliance/helper/update_sources_checksum.py | |
git diff-index --quiet HEAD || (echo "$ver_num" > dbversion && git add dbversion && git commit -am "Updated results summary" && git pull --rebase && git push) | |
HAS_CHANGES=$(git diff --staged --name-only) | |
if [ ${#HAS_CHANGES} -gt 0 ]; then | |
# Use the GitHub actor's name and email | |
git config --global user.name mlcommons-bot | |
git config --global user.email "[email protected]" | |
# Commit changes | |
git commit -am '[Automated Commit] Update checksums' | |
git push | |
fi |