Skip to content

auto-update

auto-update #1

Workflow file for this run

name: auto-update
on:
schedule:
- cron: '0 20 * * 0'
workflow_dispatch:
jobs:
auto-update:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Update requirements
uses: coatl-dev/actions/pip-compile@v3
with:
path: requirements
- name: Detect changes
id: git-diff
uses: coatl-dev/actions/simple-git-diff@v3
- name: Extract package versions and update Dockerfile
if: ${{ steps.git-diff.outputs.diff == 'true' }}
run: |
pip_version=$(grep '^pip==' requirements/base.txt | cut -d'=' -f3)
setuptools_version=$(grep '^setuptools==' requirements/base.txt | cut -d'=' -f3)
wheel_version=$(grep '^wheel==' requirements/base.txt | cut -d'=' -f3)
echo "Extracted versions:"
echo "pip: $pip_version"
echo "setuptools: $setuptools_version"
echo "wheel: $wheel_version"
sed -i "s/ENV PYTHON3_PIP_VERSION=.*/ENV PYTHON3_PIP_VERSION=$pip_version/" Dockerfile
sed -i "s/ENV PYTHON3_SETUPTOOLS_VERSION=.*/ENV PYTHON3_SETUPTOOLS_VERSION=$setuptools_version/" Dockerfile
sed -i "s/ENV PYTHON3_WHEEL_VERSION=.*/ENV PYTHON3_WHEEL_VERSION=$wheel_version/" Dockerfile
- name: Import GPG key
if: ${{ steps.git-diff.outputs.diff == 'true' }}
id: gpg-import
uses: coatl-dev/actions/gpg-import@v3
with:
passphrase: ${{ secrets.COATL_BOT_GPG_PASSPHRASE }}
private-key: ${{ secrets.COATL_BOT_GPG_PRIVATE_KEY }}
- name: Commit and push changes
if: ${{ steps.git-diff.outputs.diff == 'true' }}
run: |
git checkout -B coatl-dev-autoupdate-requirements
git add .pre-commit-config.yaml
git commit -m 'chore(python3): update requirements'
git push --force --set-upstream origin coatl-dev-autoupdate-requirements
- name: Create Pull Request
if: ${{ steps.git-diff.outputs.diff == 'true' }}
uses: coatl-dev/actions/pr-create@v3
with:
gh-token: ${{ secrets.COATL_BOT_GH_TOKEN }}