Get #203
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
| # | |
| # Copyright (C) 2022 Ing <https://github.com/wjz304> | |
| # | |
| # This is free software, licensed under the MIT License. | |
| # See /LICENSE for more information. | |
| # | |
| name: Get | |
| on: | |
| schedule: | |
| - cron: "0 12 * * *" # 每天 12:00 UTC 时间运行一次 (北京时间每天 20:00) | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| - name: Init Env | |
| run: | | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "github-actions[bot]" | |
| sudo timedatectl set-timezone "Asia/Shanghai" | |
| - name: Get fnOS/FygoOS ISO | |
| run: | | |
| chmod +x getOS.sh && ./getOS.sh | |
| - name: Check and Push | |
| if: success() | |
| run: | | |
| echo "Git push ..." | |
| # git checkout main | |
| git pull | |
| status=$(git status -s | grep -E "(fnOS.json|FygoOS.json)" | awk '{printf " %s", $2}') | |
| if [ -n "${status}" ]; then | |
| git add ${status} | |
| git commit -m "update $(date +%Y-%m-%d" "%H:%M:%S)" | |
| git push -f | |
| fi |