-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.25 KB
/
Copy pathupdate_LiveURL.yml
File metadata and controls
49 lines (42 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Update Live IPTV
on:
push:
branches: [main]
paths:
- 'auto_update/**'
workflow_dispatch:
schedule:
- cron: '01,30 * * * *'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run update script
run: bash ./auto_update/update_liveURL.sh
- name: Check for changes
id: files_changed
run: |
if [[ `git status --porcelain` ]]; then
echo "Changes detected"
echo "is_changed=1" >> $GITHUB_ENV
else
echo "No changes detected"
echo "is_changed=0" >> $GITHUB_ENV
fi
- name: Commit and Push changes
if: env.is_changed == '1'
run: |
git config --local user.email "120372062+KoolCenter@users.noreply.github.com"
git config --local user.name "KoolCenter"
git add .
git commit -m "Actions Auto Update at $(date +'%Y-%m-%d %H:%M:%S')"
git push
- name: Delete old workflow runs
uses: GitRML/delete-workflow-runs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
keep_minimum_runs: 3
retain_days: 1