From 9c96169b3d06af2ee52bfcfc022e2e123e07a62e Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Mon, 18 Sep 2023 17:55:18 +0530 Subject: [PATCH] feat: write access token to json file --- integration/forgejo.py | 4 +++- integration/lib.sh | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/integration/forgejo.py b/integration/forgejo.py index 0a9756f..d090e43 100755 --- a/integration/forgejo.py +++ b/integration/forgejo.py @@ -1,5 +1,6 @@ import os import random +import json from urllib.parse import urlunparse, urlparse from html.parser import HTMLParser from time import sleep @@ -293,5 +294,6 @@ class Forgejo: print("Created access token") data = resp.json() with open(file, "w") as f: - f.write(f"{data['sha1']}") + content = json.dumps(data) + f.write(content) print(f"Wrote access token to {file}") diff --git a/integration/lib.sh b/integration/lib.sh index 13e4ce1..1ec0a09 100755 --- a/integration/lib.sh +++ b/integration/lib.sh @@ -25,7 +25,8 @@ readonly FORGEJO_USER1_PASSWORD=supercomplicatedpassword readonly FORGEJO_USER1_EMAIL="$FORGEJO_USER1_USERNAME@example.org" readonly FORGEJO_USER1_SUPPORT_REPO="support" readonly FORGEJO_USER1_ACCESS_TOKEN_NAME="coreaccesstoken" -readonly FORGEJO_USER1_ACCESS_TOKEN_FILE_PATH=$(realpath secrets/user1-accesstoken) +readonly FORGEJO_USER1_ACCESS_TOKEN_FILE_PATH=$(realpath secrets/user1-accesstoken.json) +rm $FORGEJO_USER1_ACCESS_TOKEN_FILE_PATH || true readonly FORGEJO_TESTUSER_USERNAME=test_user readonly FORGEJO_TESTUSER_PASSWORD=supercomplicatedpassword