Skip to content

Commit 54be754

Browse files
authored
fix(github): send null job_id to fix 422 during resubmission (#269)
If a submission is failed, the tool will check and adjust/resubmit again with a newly generated job_id. For GitHub Actions, this needs to be null again.
1 parent f42e10a commit 54be754

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

coveralls/api.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,14 @@ def wear(self, dry_run=False):
235235
# attach a random value to ensure uniqueness
236236
# TODO: an auto-incrementing integer might be easier to reason
237237
# about if we could fetch the previous value
238-
new_id = '{}-{}'.format(
239-
self.config.get('service_job_id', 42),
240-
random.randint(0, sys.maxsize))
238+
# N.B. Github Actions fails if this is not set to null.
239+
# Other services fail if this is set to null. Sigh x2.
240+
if os.environ.get('GITHUB_REPOSITORY'):
241+
new_id = None
242+
else:
243+
new_id = '{}-{}'.format(
244+
self.config.get('service_job_id', 42),
245+
random.randint(0, sys.maxsize))
241246
print('resubmitting with id {}'.format(new_id))
242247

243248
self.config['service_job_id'] = new_id

0 commit comments

Comments
 (0)