-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (41 loc) · 1.11 KB
/
image-transfer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 }}