Skip to content

Commit

Permalink
Merge pull request #488 from conan-io/release/0.32.2
Browse files Browse the repository at this point in the history
Release/0.32.2
  • Loading branch information
czoido authored Mar 31, 2020
2 parents 22fc2e7 + 1460ab0 commit 7ba6f3e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

__version__ = '0.32.1'
NEWEST_CONAN_SUPPORTED = "1.23.000"
__version__ = '0.32.2'
NEWEST_CONAN_SUPPORTED = "1.24.000"


def get_client_version():
Expand Down
2 changes: 2 additions & 0 deletions cpt/ci_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ def get_branch(self):
branch = os.getenv("GITHUB_REF", None)
if self.is_pull_request():
branch = os.getenv("GITHUB_BASE_REF", "")
if branch.startswith("refs/heads/"):
branch = branch[11:]
return branch

def is_pull_request(self):
Expand Down
2 changes: 1 addition & 1 deletion cpt/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
six>=1.10.0, <1.15.0
conan>=1.7.0, <1.24.0
conan>=1.7.0, <1.25.0
tabulate>=0.8.0, <0.9.0
9 changes: 7 additions & 2 deletions cpt/test/unit/ci_manager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ def test_github_actions_instance(self):
self.assertEquals(manager.get_commit_id(), gha_env["GITHUB_SHA"])
self.assertEquals(manager.is_pull_request(), True)

gha_env = {"GITHUB_ACTIONS": "true",
"GITHUB_REF": "refs/heads/testing",
"GITHUB_EVENT_NAME": "push"}
with tools.environment_append(gha_env):
manager = CIManager(self.printer)
self.assertEquals(manager.get_branch(), "testing")

def test_build_policy(self):
# Travis
with tools.environment_append({"TRAVIS": "1",
Expand Down Expand Up @@ -289,5 +296,3 @@ def test_bamboo_env_vars(self):

self.assertEquals(os.getenv('CONAN_LOGIN_USERNAME'), "bamboo")
self.assertEquals(os.getenv('CONAN_USER_VAR'), "foobar")


0 comments on commit 7ba6f3e

Please sign in to comment.