2021-05-06 14:57:50 +02:00
name : clean
on :
workflow_dispatch :
2021-05-06 22:41:55 +02:00
schedule :
- cron : '0 6 * * 0'
2021-05-06 14:57:50 +02:00
jobs :
2021-05-06 23:23:45 +02:00
check :
2021-05-06 14:57:50 +02:00
runs-on : ubuntu-latest
2021-05-06 22:44:12 +02:00
continue-on-error : true
2021-05-06 14:57:50 +02:00
strategy :
2021-05-06 22:44:12 +02:00
fail-fast : false
2021-05-06 14:57:50 +02:00
matrix :
2021-05-07 01:52:11 +02:00
country : [
2021-05-06 22:31:54 +02:00
ad,
ae,
af,
2021-05-06 22:21:05 +02:00
al,
2021-05-06 22:31:54 +02:00
am,
ao,
ar,
at,
au,
aw,
2021-05-06 22:41:55 +02:00
az,
ba,
bb,
bd,
be,
bf,
bg,
bh,
bn,
bo,
br,
bs,
by,
ca,
cd,
cg,
ch,
ci,
cl,
cm,
cn,
co,
cr,
cu,
cw,
cy,
cz,
de,
dk,
do,
dz,
ec,
ee,
eg,
es,
et,
fi,
fj,
fo,
fr,
ge,
gh,
gm,
gn,
gp,
gq,
gr,
gt,
hk,
hn,
hr,
ht,
hu,
id,
ie,
il,
in,
iq,
ir,
is,
it,
jm,
jo,
jp,
ke,
kg,
kh,
kp,
kr,
kw,
kz,
la,
lb,
li,
lk,
lt,
lu,
lv,
ly,
ma,
mc,
md,
me,
mk,
ml,
mm,
mn,
mo,
mt,
mx,
my,
mz,
ne,
ng,
nl,
no ,
np,
nz,
om,
pa,
pe,
ph,
pk,
pl,
pr,
ps,
pt,
py,
qa,
ro,
rs,
ru,
rw,
sa,
sd,
se,
sg,
si,
sk,
sl,
sm,
sn,
so,
sv,
sy,
th,
tj,
tm,
tn,
tr,
tt,
tw,
tz,
ua,
ug,
uk,
us,
uy,
uz,
va,
ve,
vi,
vn,
xk,
ye,
2021-05-07 01:52:11 +02:00
zm
# unsorted
2021-05-06 14:57:50 +02:00
]
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Install Dependencies
run : npm install
- name : Remove Broken Links
2021-05-07 01:52:11 +02:00
run : node scripts/clean.js --country=${{ matrix.country }} --debug
2021-05-06 21:15:10 +02:00
- name : Upload Artifact
uses : actions/upload-artifact@v2
2021-05-06 21:07:47 +02:00
with :
2021-05-06 22:09:22 +02:00
name : channels
2021-05-06 22:26:14 +02:00
path : channels/${{ matrix.country }}.m3u
2021-05-06 21:07:47 +02:00
pull-request :
2021-05-06 23:23:45 +02:00
needs : check
2021-05-06 21:07:47 +02:00
runs-on : ubuntu-latest
steps :
- name : Checkout
uses : actions/checkout@v2
2021-05-06 21:15:10 +02:00
- name : Download Artifacts
uses : actions/download-artifact@v2
2021-05-06 19:44:23 +02:00
- name : Create Pull Request
uses : peter-evans/create-pull-request@v3
with :
title : '[Bot] Remove broken links'
body : |
2021-05-07 13:59:29 +02:00
This pull request is created automatically with `scripts/clean.js`.
2021-05-07 14:02:17 +02:00
The script checks each link and removes only those that return a HTTP 404 code (Not Found). Also, the script ignores links with labels `[Geo-blocked]` and `[Not 24/7]` in the title.
2021-05-07 13:59:29 +02:00
2021-05-07 14:02:17 +02:00
**IMPORTANT:** Before merging all links should be checked manually to make sure that the response from the server has not changed.
2021-05-06 22:21:05 +02:00
commit-message : '[Bot] Update playlists'
2021-05-07 14:45:08 +02:00
branch : bot/remove-broken-links
delete-branch : true