[llvm] [workflows] Fix permissions check for creating new releases (PR #81163)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 14:39:28 PST 2024


================
@@ -77,20 +77,23 @@ def upload_files(repo, release, files):
 parser.add_argument("--token", type=str)
 parser.add_argument("--release", type=str)
 parser.add_argument("--user", type=str)
+parser.add_argument("--user-token", type=str)
 
 # Upload args
 parser.add_argument("--files", nargs="+", type=str)
 
 args = parser.parse_args()
 
-github = github.Github(args.token)
-llvm_org = github.get_organization("llvm")
+gh = github.Github(args.token)
+llvm_org = gh.get_organization("llvm")
 llvm_repo = llvm_org.get_repo("llvm-project")
+if not args.user_token:
----------------
boomanaiden154 wrote:

Ah, didn't consider local testing. But yes, that was my suggestion. If it's for local testing, it shouldn't be a big deal to leave it in, but having a comment explaining what this is for would be good.

I think it would probably still be cleaner to just require `--user-token` if  `--user` is specified and pass both tokens during testing if needed, but no strong opinions there.

https://github.com/llvm/llvm-project/pull/81163


More information about the llvm-commits mailing list