Skip to content

Commit

Permalink
Merge branch 'main' into signal/detect-type
Browse files Browse the repository at this point in the history
  • Loading branch information
bennettgoble authored Mar 24, 2023
2 parents d0f4ed1 + 64aefb4 commit fd88cf7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:

- name: Upload coverage
uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-latest'
with:
env_vars: OS

Expand Down
4 changes: 4 additions & 0 deletions autobuild/autobuild_tool_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ def download_package(package_url: str, timeout=120, creds=None, package_name="")
token_var = CREDENTIAL_ENVVARS[creds]
except KeyError:
logger.warning(f"Unrecognized creds={creds} value")

if creds == "github":
# Request octet-stream if creds=github, or else we'll get a JSON response back
req.add_unredirected_header("Accept", "application/octet-stream")

token = os.environ.get(token_var)
if token:
Expand Down
1 change: 1 addition & 0 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ def test_download_github(self, mock_urlopen: MagicMock):
mock_urlopen.assert_called()
got_req = mock_urlopen.mock_calls[0].args[0]
self.assertEqual(got_req.unredirected_hdrs["Authorization"], "Bearer token-123")
self.assertEqual(got_req.unredirected_hdrs["Accept"], "application/octet-stream")

@patch("urllib.request.urlopen")
def test_download_gitlab(self, mock_urlopen: MagicMock):
Expand Down

0 comments on commit fd88cf7

Please sign in to comment.