dannymartinm commented on code in PR #23158: URL: https://github.com/apache/beam/pull/23158#discussion_r971298889
########## .github/gh-actions-self-hosted-runners/helper-functions/cloud-functions/generateToken/index.js: ########## @@ -0,0 +1,77 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +//This function provides registration tokens for windows and linux self-hosted +//runners, a service account with the appropriated permissions should be used to +// invoke the Cloud Function. + +import functions from '@google-cloud/functions-framework'; +import { Octokit } from "octokit"; +import { createAppAuth } from "@octokit/auth-app"; + +const REQUIRED_ENV_VARS=["APP_ID","PEM_KEY","CLIENT_ID","CLIENT_SECRET","APP_INSTALLATION_ID","ORG"] Review Comment: Yes, it's the same. We are using these `js` scripts in Cloud Functions so we did a couple of changes in here, like removing the `http` function, in order to give visibility to the community and to make the functions work in their locals. We can add `REQUIRED_ENV_VARS` as an import here in the code but I think that in the Cloud Functions the change might not be needed as we will need an extra GCP service to share resources/data, likewise having an extra `js` file for one constant will increase the redundancy. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
