From 2a9f57370305c521b95f05d40e88627e3bcc0d5c Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:07:29 -0400 Subject: [PATCH] Secure Source of Randomness (#27) Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> --- ci/gitlab/pipeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/gitlab/pipeline.py b/ci/gitlab/pipeline.py index 733bb0d..2f33eea 100644 --- a/ci/gitlab/pipeline.py +++ b/ci/gitlab/pipeline.py @@ -1,10 +1,10 @@ import os import gitlab -import random import sys import json import whatthepatch import base64 +import secrets # GitLab settings @@ -13,7 +13,7 @@ project_id = os.environ.get("CI_MERGE_REQUEST_PROJECT_ID") source_branch = os.environ.get("CI_MERGE_REQUEST_SOURCE_BRANCH_NAME") new_branch_name = "pixee_" + str( - random.randint(0, 1000) + secrets.SystemRandom().randint(0, 1000) ) # Replace with the desired new branch name merge_id = os.environ.get("CI_MERGE_REQUEST_IID")