Skip to content

Commit

Permalink
Tryit pr use bot token (#2749)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored Dec 12, 2023
1 parent e52a32c commit b88e402
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 37 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/tryit-comment.yml

This file was deleted.

5 changes: 5 additions & 0 deletions eng/pipelines/pr-tryit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ jobs:
--destination-path $(TYPESPEC_WEBSITE_BASE_PATH) \
--source "./packages/website/build/" \
--overwrite
- script: node eng/scripts/create-tryit-comment.js "cadl-azure"
displayName: Check already commented
env:
GH_TOKEN: $(azuresdk-github-pat)
6 changes: 5 additions & 1 deletion eng/scripts/create-tryit-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ async function main() {
const folderName = process.argv.length > 2 ? `/${process.argv[2]}` : "";
const repo = process.env["BUILD_REPOSITORY_ID"];
const prNumber = process.env["SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"];
const ghAuth = getGithubAuthHeader(repo);
const ghToken = process.env.GH_TOKEN;
if (ghToken === undefined) {
throw new Error("GH_TOKEN environment variable is not set");
}
const ghAuth = `Bearer ${ghToken}`;

console.log("Looking for comments in", { repo, prNumber });
const data = await listComments(repo, prNumber, ghAuth);
Expand Down

0 comments on commit b88e402

Please sign in to comment.