Update repository with latest information #87
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 repository with latest information" | |
on: | |
push: | |
schedule: | |
# each day at 4:40 | |
- cron: '40 4 * * *' | |
workflow_dispatch: | |
jobs: | |
update_repository: | |
name: "Update repository with latest information" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout to workspace | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
architecture: 'x64' | |
- name: Print all environment variables | |
run: printenv | |
- name: Set bot's name and email | |
run: | | |
git config --global user.name "Github Action" | |
git config --global user.email "[email protected]" | |
- name: Install requirements.txt | |
run: | | |
python -m pip install -U setuptools | |
python -m pip install -U pip | |
python -m pip install -r util/requirements.txt | |
- name: Update Dockerfile.scratch-minimal and Dockerfile.scratch-full | |
run: python util/update-scratch-dockerfile-python-versions.py Dockerfile.scratch-minimal Dockerfile.scratch-full | |
- name: Update README.rst table | |
run: python util/update-readme-table.py README.rst . | |
- name: Commit changed files | |
if: always() | |
run: | | |
git add README.rst Dockerfile.scratch-minimal Dockerfile.scratch-full && \ | |
(git commit -m "[Github Action] Update README table and Dockerfile.scratch with latest information" || true) && \ | |
git checkout . && \ | |
git pull origin ${GITHUB_REF##*/} --rebase --strategy-option=ours | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
branch: ${{ github.ref }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} |