testtvbox #5
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: testtvbox | |
on: | |
schedule: | |
# 每天的09:50执行 | |
- cron: '50 09 * * *' | |
env: | |
TZ: Asia/Shanghai | |
jobs: | |
Update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download IPTV List | |
run: | | |
# 下载IPTV列表 | |
rm -f IPTV-tvbox.txt && curl -o IPTV-tvbox.txt https://fanmingming.com/txt?url=https://live.fanmingming.com/tv/m3u/ipv6.m3u | |
sed -i '/#EXTM3U/d; /^\s*$/d' IPTV-tvbox.txt | |
- name: Prepare Commit Message | |
id: prepare_commit | |
run: echo "DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV | |
- name: Clean and Prepare Git | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add -A | |
git commit -am "Update IPTV list at ${DATE}" | |
- name: Push Changes | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
if [[ $(git status --porcelain) ]]; then | |
git push origin main | |
fi |