-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.23 KB
/
random-gifs.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
name: Create Random GIFs
on:
schedule:
- cron: "0 0 1 * *"
permissions:
contents: write
jobs:
create_random_gifs:
runs-on: ubuntu-latest
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
repo_user: "T3l3sc0p3"
repo_name: "CDN-for-personal-use"
branch: "Kuriyama-Mirai"
directory: "gifs"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
check-latest: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests pyyaml
- name: Create random gifs
run: |
file_name="README.md"
python ".github/script/random-gif.py" "$file_name" "p"
if [[ $(git status --porcelain) ]]; then
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add "$file_name"
git commit -m "Create random GIFs"
git push
else
echo "No changes detected"
fi