From 2314c72bd993cfda5742001348d5f0820e81329b Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sun, 23 Jul 2023 12:05:45 -0700 Subject: [PATCH] Make spreadsheet dynamic based on branch name (#181) --- .github/workflows/ci.yml | 1 + send_to_googledrive.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c638c81..15c7bf5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -206,3 +206,4 @@ jobs: fi env: GDRIVE_BASE64: ${{ secrets.GDRIVE_BASE64 }} + GITHUB_REF_NAME: ${{ github.ref_name }} diff --git a/send_to_googledrive.py b/send_to_googledrive.py index aa074ea6..0e2cebe5 100644 --- a/send_to_googledrive.py +++ b/send_to_googledrive.py @@ -94,7 +94,8 @@ creds = ServiceAccountCredentials.from_json_keyfile_dict(creds_info, scope) client = gspread.authorize(creds) # Get the instance of the Spreadsheet -sheet = client.open("benchmark") +branch_name = os.getenv("GITHUB_REF_NAME") +sheet = client.open(f"benchmark-{branch_name}") # Get the first sheet of the Spreadsheet sheet_instance = sheet.get_worksheet(0)