Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tryit pr use bot token #2749

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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