Update live.yml
This commit is contained in:
parent
d06029dae5
commit
13ae7ae830
19
.github/workflows/live.yml
vendored
19
.github/workflows/live.yml
vendored
@ -16,12 +16,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: 检出仓库
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: 设置Python环境
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
python-version: '3.8'
|
||||
|
||||
- name: 安装依赖
|
||||
run: |
|
||||
@ -46,6 +46,14 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 使用 curl 下载内容,并在第 1 到第 3 行插入指定说明文字
|
||||
- name: Insert lines on line 1 和 2 和 3
|
||||
run: |
|
||||
DATE=$(date +"%m/%d")
|
||||
sed -i '1i #EXTM3U x-tvg-url="https://epg.v1.mk/fy.xml"' live.m3u
|
||||
sed -i '2i #EXTINF:-1 tvg-logo="https://codeberg.org/alantang/photo/raw/branch/main/photo_2025-03-16_10-57-18.jpg" group-title="收藏频道",更新'"$DATE"'' live.m3u
|
||||
sed -i '3i http://tencentplaygzrb01.gztv.com/live/zonghes.m3u8' live.m3u
|
||||
|
||||
- name: 提交更改
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@ -53,11 +61,10 @@ jobs:
|
||||
DATE=$(date +"%Y-%m-%d %H:%M:%S")
|
||||
git config --global user.name "GitHub Actions"
|
||||
git config --global user.email "actions@github.com"
|
||||
git add live/live.m3u live/live.txt
|
||||
git add live.m3u
|
||||
if git diff-index --quiet HEAD --; then
|
||||
echo "没有更改需要提交更新: $DATE"
|
||||
else
|
||||
git commit -m "自动更新 M3U 和 TXT 文件: $DATE"
|
||||
git commit -m "自动更新 M3U 播放列表: $DATE"
|
||||
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user