From 0d7d1a7284ed60c995ce0414c1cbeb309ebb4374 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 12 Jun 2024 09:34:39 -0400 Subject: [PATCH] fix: switches user id to an env variable --- .github/workflows/build.yml | 1 + packages/msgraph-sdk-tests/userTests.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a54c5d3fa6f..9e62d8510a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,7 @@ jobs: TENANT_ID: ${{secrets.tenant_id}} CLIENT_ID: ${{secrets.client_id}} CLIENT_SECRET: ${{secrets.client_secret}} + USER_ID: ${{secrets.user_id}} # The check-build-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure. # Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks. diff --git a/packages/msgraph-sdk-tests/userTests.ts b/packages/msgraph-sdk-tests/userTests.ts index 81edfacdc2b..d4aea41465d 100644 --- a/packages/msgraph-sdk-tests/userTests.ts +++ b/packages/msgraph-sdk-tests/userTests.ts @@ -10,8 +10,12 @@ describe("TestGet", () => { }); it("should return messages for given user", async () => { + const userId = process.env.USER_ID; + if (!userId) { + throw Error("Missing USER_ID environment variable"); + } const messages = await graphServiceClient.users - .byUserId("a4bf4e43-981f-430c-8024-cdb645f8c098") + .byUserId(userId) .messages.get(); assert.isDefined(messages?.value); });