Skip to content

Commit

Permalink
ci 失败提醒
Browse files Browse the repository at this point in the history
  • Loading branch information
virusdefender committed Nov 19, 2019
1 parent 8e14ff4 commit 2dbb4b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: python
install:
- pip install -U pip
- pip install pyyaml rfc3987 jsonschema yamllint
- pip install pyyaml rfc3987 jsonschema yamllint requests
jobs:
include:
- stage: check_poc
Expand Down
5 changes: 5 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import pathlib
import re
import requests
import subprocess

import yaml
Expand Down Expand Up @@ -86,5 +87,9 @@ def check_yaml_lint():
for item in yaml_lint_output:
msg += " - " + item + "\n"
print(msg)

pr_id = os.environ.get("TRAVIS_PULL_REQUEST")
if pr_id and pr_id != "false":
requests.post("https://api.github.com/repos/chaitin/xray/issues/" + pr_id + "/comments", json={"body": msg}, headers={"Authorization": os.environ.get("githb_basic_auth")})
if msg:
exit(1)

0 comments on commit 2dbb4b5

Please sign in to comment.