Skip to content

Commit

Permalink
[ci] Fix action expressions for tvm-bot workflow
Browse files Browse the repository at this point in the history
These weren't caught by `actionlint` for some reason but GitHub doesn't merge multiple `if`s, so this combines them into one.
  • Loading branch information
driazati committed Jun 2, 2022
1 parent 017d410 commit 3f15d19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/tvmbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ concurrency:

jobs:
run-tvm-bot:
if: github.repository == 'apache/tvm'
if: ${{ github.event.issue.pull_request && github.repository == 'driazati/tvm' }}
runs-on: ubuntu-20.04
if: ${{ github.event.issue.pull_request }}
steps:
- uses: actions/checkout@v2
- name: Run tvm-bot
Expand Down
6 changes: 3 additions & 3 deletions tests/scripts/git_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def compress_query(query: str) -> str:
def post(url: str, body: Optional[Any] = None, auth: Optional[Tuple[str, str]] = None):
print(f"Requesting POST to", url, "with", body)
headers = {}
req = request.Request(url, headers=headers, method="POST")
if auth is not None:
auth_str = base64.b64encode(f"{auth[0]}:{auth[1]}")
request.add_header("Authorization", f"Basic {auth_str}")
auth_str = base64.b64encode(f"{auth[0]}:{auth[1]}".encode())
req.add_header("Authorization", f"Basic {auth_str}")

if body is None:
body = ""

req.add_header("Content-Type", "application/json; charset=utf-8")
req = request.Request(url, headers=headers, method="POST")
data = json.dumps(body)
data = data.encode("utf-8")
req.add_header("Content-Length", len(data))
Expand Down

0 comments on commit 3f15d19

Please sign in to comment.