Conversation
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
… bug in `LiveCanvas`, and upgraded Fluid version (#775)
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: Ryan Bliss <smile@ryanbliss.me> Co-authored-by: James Hunt <jameshunt@microsoft.com>
…bo package (#781) Co-authored-by: James Hunt <jameshunt@microsoft.com> Co-authored-by: Ryan Bliss <smile@ryanbliss.me>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
…fter npm install, other V2 prep (#786) Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com> Co-authored-by: Ryan Bliss <smile@ryanbliss.me>
…m support (#791) Co-authored-by: James Hunt <jameshunt@microsoft.com>
…0.0, removed references to live-share-turbo
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: huntj88 <huntj88@gmail.com> Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: huntj88 <huntj88@gmail.com> Co-authored-by: Ryan Bliss <smile@ryanbliss.me>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: huntj88 <10103298+huntj88@users.noreply.github.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20.x, 22.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: "npm" | ||
| - run: npm --loglevel verbose ci --ignore-scripts | ||
| timeout-minutes: 20 | ||
|
|
||
| - run: npm install jest | ||
| working-directory: samples/javascript/02.react-video | ||
|
|
||
| - name: "build packages and samples" | ||
| run: npm run build | ||
|
|
||
| # TODO: get scenario_test.sh working | ||
|
|
||
| # - name: "test 02.react-video sample" | ||
| # shell: "bash" | ||
| # run: sh ../../../.github/workflows/scenario_test.sh | ||
| # working-directory: samples/javascript/02.react-video |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 days ago
In general, the fix is to add a permissions: block that explicitly scopes the GITHUB_TOKEN to the least privileges the workflow needs. For this workflow, it only checks out code and installs/builds dependencies, so contents: read is sufficient.
The best minimal fix without changing existing behavior is to add a workflow-level permissions: block right after the name: (or before jobs:). This will apply to all jobs that do not define their own permissions. We will set:
permissions:
contents: readThis ensures that the GITHUB_TOKEN can read repository contents (needed for actions/checkout if the repo is private) but cannot write. No additional methods, imports, or definitions are required; it is purely a YAML configuration change in .github/workflows/live-share-build-samples.yaml.
Concretely, edit .github/workflows/live-share-build-samples.yaml to insert a permissions: section between line 2 and line 3 (between the workflow name and the on: block).
| @@ -1,5 +1,8 @@ | ||
| name: Build Live Share SDK samples | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, mainv2] |
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20.x, 22.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: "npm" | ||
|
|
||
| - run: npm --loglevel verbose ci --ignore-scripts | ||
| timeout-minutes: 20 | ||
|
|
||
| - name: "check formatting" | ||
| run: "bash checkFormatting.sh" | ||
| working-directory: .github/workflows |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 days ago
In general, the fix is to explicitly declare a permissions block for the workflow or for the specific job, setting least‑privilege scopes instead of relying on inherited defaults. For a formatting‑check workflow that only needs to read the repository contents, contents: read is an appropriate minimal setting.
For this concrete file, the simplest and least intrusive fix is to add a root‑level permissions: block (applies to all jobs) immediately after the name: or on: section, specifying only contents: read. This documents the intent and ensures the GITHUB_TOKEN cannot write to the repository even if the org/repo default is broader. No additional libraries, imports, or functional changes are required because permissions configuration is purely declarative in the workflow YAML.
Concretely: in .github/workflows/live-share-formatting.yaml, insert:
permissions:
contents: readright after the on: block (or right after name:); keeping existing indentation consistent with the file. No other edits are needed.
| @@ -7,6 +7,9 @@ | ||
| branches: [main, mainv2, "user/**", "copilot/**"] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest |
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20.x, 22.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: "npm" | ||
| - run: npm --loglevel verbose ci --ignore-scripts | ||
| timeout-minutes: 20 | ||
|
|
||
| - run: npm run prepare # will trigger a build of all packages | ||
|
|
||
| - name: "test live-share" | ||
| run: npm run test | ||
| working-directory: packages/live-share | ||
|
|
||
| - name: "test live-share-canvas" | ||
| run: npm run test | ||
| working-directory: packages/live-share-canvas | ||
|
|
||
| - name: "test live-share-media" | ||
| run: npm run test | ||
| working-directory: packages/live-share-media |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 days ago
Generally, this issue is fixed by adding an explicit permissions block to the workflow or specific job(s), limiting GITHUB_TOKEN to the minimal required scopes (typically contents: read for a pure CI job). This prevents the workflow from inheriting broader default permissions from the repository or organization.
For this workflow, the best fix without changing functionality is to add a permissions block at the workflow root (top-level, alongside name and on). The job only checks out code and runs Node/npm commands; it does not need to write to the repository or other resources via the GitHub API. Therefore, contents: read is sufficient and matches the minimal starting point suggested by CodeQL. Concretely, in .github/workflows/live-share-test-packages.yaml, insert:
permissions:
contents: readbetween the existing on: block and the jobs: block (i.e., after line 8 and before line 10). No additional imports, methods, or definitions are needed since this is just a YAML configuration change.
| @@ -7,6 +7,9 @@ | ||
| branches: [main, mainv2, "user/**", "copilot/**"] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest |
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20.x, 22.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: "npm" | ||
| - run: npm --loglevel verbose ci --ignore-scripts | ||
| timeout-minutes: 20 | ||
|
|
||
| - run: npm run prepare # will trigger a build of all packages | ||
|
|
||
| - name: "test live-share with cjs app" | ||
| run: npm run test | ||
| working-directory: internal/usage-test/cjs-test | ||
|
|
||
| - name: "test live-share with esm app" | ||
| run: npm run test | ||
| working-directory: internal/usage-test/esm-test | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| name: Install pnpm for next step | ||
| with: | ||
| version: 9 | ||
| run_install: false | ||
| - name: "test live-share with pnpm typescript esm app" | ||
| run: pnpm run test | ||
| working-directory: internal/usage-test/pnpm-test |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 days ago
In general, the fix is to add an explicit permissions: block declaring the minimal scopes needed by this workflow. For a test-only workflow that just checks out code and runs Node/npm/pnpm commands, contents: read is typically sufficient. Declaring this at the workflow root will apply to all jobs that do not override permissions.
The single best fix here, without changing functionality, is to add a root-level permissions: block right after the name: (before on:) in .github/workflows/live-share-test-usage.yaml:
name: Test Usage of Live Share SDK packages in different JS environments
permissions:
contents: readThis restricts the GITHUB_TOKEN to read-only access to repository contents, which supports actions/checkout@v4 and normal test execution, while avoiding unnecessary write powers. No additional imports, methods, or other definitions are needed; it is purely a YAML configuration change in this workflow file.
| @@ -1,4 +1,6 @@ | ||
| name: Test Usage of Live Share SDK packages in different JS environments | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |
No description provided.