Make spreadsheet dynamic based on branch name (#181)

pull/5155/head
merwanehamadi 2023-07-23 12:05:45 -07:00 committed by GitHub
parent 6b426e29c5
commit 2314c72bd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -206,3 +206,4 @@ jobs:
fi
env:
GDRIVE_BASE64: ${{ secrets.GDRIVE_BASE64 }}
GITHUB_REF_NAME: ${{ github.ref_name }}

View File

@ -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)