mirror of
https://github.com/public-apis/public-apis.git
synced 2025-06-25 22:17:13 +02:00
Validate all links every day at 00:00 (#1414)
Co-authored-by: Yann Bertrand <5855339+yannbertrand@users.noreply.github.com>
This commit is contained in:
parent
7de538241d
commit
46685f9a2a
2 changed files with 21 additions and 1 deletions
19
.github/workflows/validate_links.yml
vendored
Normal file
19
.github/workflows/validate_links.yml
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
name: "Validate links"
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORMAT_FILE: README.md
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: 'Validate README.md'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Validate all links from README.md
|
||||||
|
run: build/validate_links.sh ${FORMAT_FILE}
|
|
@ -33,9 +33,10 @@ def validate_links(links):
|
||||||
errors.append("TMO: " + link)
|
errors.append("TMO: " + link)
|
||||||
except socket.error as socketerror:
|
except socket.error as socketerror:
|
||||||
errors.append("SOC: {} : {}".format(socketerror, link))
|
errors.append("SOC: {} : {}".format(socketerror, link))
|
||||||
|
except Exception as e:
|
||||||
|
errors.append("ERR: {} : {}".format(e, link))
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
num_args = len(sys.argv)
|
num_args = len(sys.argv)
|
||||||
if num_args < 2:
|
if num_args < 2:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue