Auto Update Bing Images Json #135
This file contains hidden or 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: Auto Update Bing Images Json | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 1 * * *" | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# checkout | |
- name: checkout | |
uses: actions/checkout@v2 | |
# setup nodejs | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.x | |
- run: node ./assets/js/bing.js | |
# commit | |
- name: commit file | |
run: | | |
git config --local user.email 'github-actions[bot]@users.noreply.github.com' | |
git config --local user.name 'github-actions[bot]' | |
git diff --exit-code || git add . && git commit -am '[bot] update images.json' --allow-empty | |
# push | |
- name: push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} |