diff --git a/pytest_mergify/resources/github_actions.py b/pytest_mergify/resources/github_actions.py index f505bc0..90e62f8 100644 --- a/pytest_mergify/resources/github_actions.py +++ b/pytest_mergify/resources/github_actions.py @@ -30,7 +30,7 @@ def detect(self) -> Resource: if "GITHUB_SERVER_URL" in os.environ and "GITHUB_REPOSITORY" in os.environ: attributes[vcs_attributes.VCS_REPOSITORY_URL_FULL] = ( - os.environ["GITHUB_SERVER_URL"] + os.environ["GITHUB_REPOSITORY"] + os.environ["GITHUB_SERVER_URL"] + "/" + os.environ["GITHUB_REPOSITORY"] ) for attribute_name, envvar in self.OPENTELEMETRY_GHA_MAPPING.items(): diff --git a/tests/test_resources.py b/tests/test_resources.py index 98a77bb..87fab29 100644 --- a/tests/test_resources.py +++ b/tests/test_resources.py @@ -39,8 +39,13 @@ def test_span_github_actions( # Do a partial reconfig, half GHA, half local to have spans monkeypatch.setenv("GITHUB_ACTIONS", "true") monkeypatch.setenv("GITHUB_REPOSITORY", "Mergifyio/pytest-mergify") + monkeypatch.setenv("GITHUB_SERVER_URL", "https://github.com") result, spans = pytester_with_spans() assert all( span.resource.attributes["vcs.repository.name"] == "Mergifyio/pytest-mergify" for span in spans.values() ) + assert all( + span.resource.attributes["vcs.repository.url.full"] == "https://github.com/Mergifyio/pytest-mergify" + for span in spans.values() + )