Skip to content

Commit e15fa75

Browse files
authored
Merge pull request #646 from py-cov-action/fix-e2e-tests
2 parents 63f52f4 + ec63b7f commit e15fa75

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
COVERAGE_COMMENT_E2E_GITHUB_TOKEN_USER_1: ${{ secrets.COVERAGE_COMMENT_E2E_GITHUB_TOKEN_USER_1 }}
5050
COVERAGE_COMMENT_E2E_GITHUB_TOKEN_USER_2: ${{ secrets.COVERAGE_COMMENT_E2E_GITHUB_TOKEN_USER_2 }}
5151
COVERAGE_COMMENT_E2E_ACTION_REF: ${{ github.sha }}
52+
COVERAGE_COMMENT_E2E_REPOSITORY_OWNER: ${{ github.repository_owner }}
5253
COVERAGE_COMMENT_E2E_REPO_SUFFIX: ${{ github.event.number }}
5354

5455
- name: Coverage comment

tests/end_to_end/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ def action_ref():
9191
return os.environ.get("COVERAGE_COMMENT_E2E_ACTION_REF", "main")
9292

9393

94+
@pytest.fixture
95+
def repository_owner():
96+
return os.environ.get("COVERAGE_COMMENT_E2E_REPOSITORY_OWNER", "py-cov-action")
97+
98+
9499
@pytest.fixture
95100
def _gh(call, gh_config_dir):
96101
def gh(*args, token, json=False, fail_value=None):
@@ -194,7 +199,7 @@ def gh_other_username(gh_other):
194199

195200

196201
@pytest.fixture
197-
def git_repo(cd, git, action_ref, code_path, subproject_id):
202+
def git_repo(cd, git, action_ref, repository_owner, code_path, subproject_id):
198203
with cd("repo") as repo:
199204
git("init", "-b", "main")
200205
# Copy .github
@@ -214,6 +219,7 @@ def git_repo(cd, git, action_ref, code_path, subproject_id):
214219
for file in (repo / ".github/workflows").iterdir():
215220
content = (
216221
file.read_text()
222+
.replace("__ACTION_REPOSITORY_OWNER__", repository_owner)
217223
.replace("__ACTION_REF__", action_ref)
218224
.replace("__ACTION_COVERAGE_PATH__", str(code_path))
219225
.replace("__ACTION_SUBPROJECT_ID__", json_module.dumps(subproject_id))

tests/end_to_end/repo/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Coverage comment
3333
id: coverage_comment
34-
uses: py-cov-action/python-coverage-comment-action@__ACTION_REF__
34+
uses: __ACTION_REPOSITORY_OWNER__/python-coverage-comment-action@__ACTION_REF__
3535
with:
3636
GITHUB_TOKEN: ${{ github.token }}
3737
ANNOTATE_MISSING_LINES: true

0 commit comments

Comments
 (0)