Skip to content

Update: 计算机网络 #9

Update: 计算机网络

Update: 计算机网络 #9

name: Transfer Images
on:
push:
paths:
- 'docs/**/*.md'
jobs:
image_transfer:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: pip install requests
- name: Run image transfer script
env:
API_TOKEN: ${{ secrets.API_TOKEN }}
UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
run: python transform.py
- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Check for changes
id: check_changes
run: |
if git diff --quiet; then
echo "No changes to commit"
exit 0
fi
- name: Commit and push changes
if: steps.check_changes.outputs.changes == 'true'
run: |
git add .
git commit -m "Update image links"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}