diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index e5de020a..891ec53d 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -106,6 +106,11 @@ jobs: publish-docker-image: name: Publish Unit Test Results (Docker Image) needs: test + # we run the action from this branch whenever we can (when it runs in our repo's context) + if: > + always() && + github.event.sender.login != 'dependabot[bot]' && + ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository ) runs-on: ubuntu-latest steps: diff --git a/publish_unit_test_results.py b/publish_unit_test_results.py index cae207ed..5a18e92c 100644 --- a/publish_unit_test_results.py +++ b/publish_unit_test_results.py @@ -32,7 +32,7 @@ def get_conclusion(parsed: ParsedUnitTestResults, fail_on_failures, fail_on_erro def get_github(token: str, url: str, retries: int, backoff_factor: float) -> github.Github: retry = Retry(total=retries, backoff_factor=backoff_factor, - method_whitelist=Retry.DEFAULT_METHOD_WHITELIST.union({'GET', 'POST'}), + allowed_methods=Retry.DEFAULT_ALLOWED_METHODS.union({'GET', 'POST'}), status_forcelist=range(500, 600)) return github.Github(login_or_token=token, base_url=url, retry=retry) diff --git a/requirements.txt b/requirements.txt index cf1abbca..7e133b03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +# dataclasses does not exist in Python3.6, needed as dependency +dataclasses junitparser==1.6.1 PyGithub==1.54.1 -dataclasses +urllib3==1.26.4 diff --git a/test/requirements.txt b/test/requirements.txt index e0ff39c3..16111baa 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -2,4 +2,5 @@ flask mock pytest pyyaml>=5.1 -requests \ No newline at end of file +requests +urllib3<2.0.0 \ No newline at end of file diff --git a/test/test_github.py b/test/test_github.py index eb18656f..1d7642d2 100644 --- a/test/test_github.py +++ b/test/test_github.py @@ -1,4 +1,5 @@ import logging +import sys import time import unittest from multiprocessing import Process @@ -9,6 +10,7 @@ from publish_unit_test_results import get_github +@unittest.skipIf(sys.platform != 'linux', 'Pickling the mock REST endpoint only works Linux') class TestGitHub(unittest.TestCase): base_url = f'http://localhost:12380/api'