From 21f81978f8f8d82fbcc2e8087bd39c952cbee74a Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Wed, 24 Aug 2022 12:18:25 -0400 Subject: [PATCH] Add a script to patch a Gemfile.lock for a plugin --- bin/ci/patch_plugin_gemfile_lock | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 bin/ci/patch_plugin_gemfile_lock diff --git a/bin/ci/patch_plugin_gemfile_lock b/bin/ci/patch_plugin_gemfile_lock new file mode 100755 index 000000000000..55cbd5400749 --- /dev/null +++ b/bin/ci/patch_plugin_gemfile_lock @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import os +import re + +with open('Gemfile.lock') as f: + gemfile_lock = f.read() + +gemfile_lock_patched = re.compile("GIT\n remote: %s/%s\n revision: .+\n branch: .+\n" %(os.environ['GITHUB_SERVER_URL'], os.environ['GITHUB_REPOSITORY'])).sub('PATH\n remote: .\n', gemfile_lock) + +with open('Gemfile.lock', 'w') as f: + f.write(gemfile_lock_patched)