From 8a8f4cada57ab5ea39d0ee48bdf1258745df1cfe Mon Sep 17 00:00:00 2001 From: Jinge Li <9894243+chinapandaman@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:08:34 +0000 Subject: [PATCH 1/3] PPF-696: use env var for token --- scripts/create_release.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/create_release.py b/scripts/create_release.py index bfe18652..27870f0e 100644 --- a/scripts/create_release.py +++ b/scripts/create_release.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- """Creates a GitHub release.""" +import os import re import sys from getpass import getpass @@ -17,7 +18,11 @@ sys.exit(f"v{latest_version} is already deployed.") print(f"Bumping to: v{version}") - token = getpass("Enter GitHub Token: ") + token = os.environ.get("GITHUB_TOKEN") + if not token: + token = getpass("Enter GitHub Token: ") + else: + input("Press Enter to continue...") url = "https://api.github.com/repos/chinapandaman/PyPDFForm/releases" headers = { From 5e13738e3b48fe848834fd32dbedca14316281a3 Mon Sep 17 00:00:00 2001 From: Jinge Li <9894243+chinapandaman@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:09:56 +0000 Subject: [PATCH 2/3] PPF-696: update release issue and PR --- docs/dev_release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev_release.md b/docs/dev_release.md index b3e93795..05a39750 100644 --- a/docs/dev_release.md +++ b/docs/dev_release.md @@ -2,7 +2,7 @@ A PyPDFForm release starts with the following steps: -* A release [issue](https://github.com/chinapandaman/PyPDFForm/issues/646) and [PR](https://github.com/chinapandaman/PyPDFForm/pull/647). +* A release [issue](https://github.com/chinapandaman/PyPDFForm/issues/686) and [PR](https://github.com/chinapandaman/PyPDFForm/pull/687). * A new [GitHub release](https://github.com/chinapandaman/PyPDFForm/releases) with auto-generated changelogs. Once these steps are done, the CI for deployment will be triggered. From a5fd056f4b5644e1ebd0e9e0265733045656b3de Mon Sep 17 00:00:00 2001 From: Jinge Li <9894243+chinapandaman@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:15:32 +0000 Subject: [PATCH 3/3] PPF-696: one more level of confirmation --- scripts/create_release.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/create_release.py b/scripts/create_release.py index 27870f0e..de980291 100644 --- a/scripts/create_release.py +++ b/scripts/create_release.py @@ -22,7 +22,9 @@ if not token: token = getpass("Enter GitHub Token: ") else: - input("Press Enter to continue...") + cont = input("Enter Yes to continue: ") + if cont != "Yes": + sys.exit("Aborted.") url = "https://api.github.com/repos/chinapandaman/PyPDFForm/releases" headers = {