Create Random GIFs #12
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: 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 |