Skip to content

Conversation

@huntj88
Copy link
Contributor

@huntj88 huntj88 commented Aug 29, 2024

No description provided.

huntj88 and others added 29 commits February 26, 2024 16:20
… bug in `LiveCanvas`, and upgraded Fluid version (#775)
Co-authored-by: Ryan Bliss <[email protected]>
Co-authored-by: James Hunt <[email protected]>
…bo package (#781)

Co-authored-by: James Hunt <[email protected]>
Co-authored-by: Ryan Bliss <[email protected]>
…fter npm install, other V2 prep (#786)

Co-authored-by: James Hunt <[email protected]>
…0.0, removed references to live-share-turbo
ryanbliss and others added 23 commits August 30, 2024 15:39
Co-authored-by: James Hunt <[email protected]>
Co-authored-by: James Hunt <[email protected]>
Co-authored-by: huntj88 <[email protected]>
Co-authored-by: Ryan Bliss <[email protected]>
Comment on lines +12 to +39
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

To fix the issue, add a permissions block with least-privilege required by the workflow. As all current steps only read repository contents and never write to them (e.g., no pushes, PR creation, artifact upload), the minimal needed permission is for reading repository contents (contents: read).

The CodeQL warning suggests placing the permissions block either at the workflow root or inside the job. Adding it at the root ensures it applies to all jobs (present and future) unless overridden.

Edit the file .github/workflows/live-share-build-samples.yaml, and add the following block near the top, after the name: field and before/until jobs:. Ensure proper indentation and spacing. No new imports or methods are needed.


Suggested changeset 1
.github/workflows/live-share-build-samples.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/live-share-build-samples.yaml b/.github/workflows/live-share-build-samples.yaml
--- a/.github/workflows/live-share-build-samples.yaml
+++ b/.github/workflows/live-share-build-samples.yaml
@@ -1,4 +1,6 @@
 name: Build Live Share SDK samples
+permissions:
+  contents: read
 
 on:
     push:
EOF
@@ -1,4 +1,6 @@
name: Build Live Share SDK samples
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +12 to +31
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

To fix the problem, add a permissions block to the workflow YAML to explicitly restrict the privileges granted to the GitHub Actions jobs. The block can be set either at the root (applies to all jobs) or inside each job. The best practice is to set the minimum permissions needed; for most formatting checks and “checkout”/read operations, contents: read is sufficient.

  • Add the following block 'permissions:\n contents: read' right after the name: line (global) or inside the jobs/build: job (per-job).
  • Since all steps shown only read files, run bash scripts, and do not publish or modify repo contents, contents: read is appropriate.
  • No changes to imports, extra method definitions, or downstream workflow content are needed.

Suggested changeset 1
.github/workflows/live-share-formatting.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/live-share-formatting.yaml b/.github/workflows/live-share-formatting.yaml
--- a/.github/workflows/live-share-formatting.yaml
+++ b/.github/workflows/live-share-formatting.yaml
@@ -1,4 +1,6 @@
 name: Check formatting
+permissions:
+  contents: read
 
 on:
     push:
EOF
@@ -1,4 +1,6 @@
name: Check formatting
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +12 to +40
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

To fix the problem, we need to add a permissions: block specifying the least required privileges for the workflow. As all steps only need access to repository contents, the recommended setting is contents: read. This should be added near the top of the workflow file—directly after name: and before on:, so that it applies to the entire workflow (and therefore, all jobs within it). No code functionality is changed; just the permissions granted to the workflow's GITHUB_TOKEN. No imports or additional definitions are required.

Suggested changeset 1
.github/workflows/live-share-test-packages.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/live-share-test-packages.yaml b/.github/workflows/live-share-test-packages.yaml
--- a/.github/workflows/live-share-test-packages.yaml
+++ b/.github/workflows/live-share-test-packages.yaml
@@ -1,4 +1,6 @@
 name: Test Live Share SDK packages
+permissions:
+    contents: read
 
 on:
     push:
EOF
@@ -1,4 +1,6 @@
name: Test Live Share SDK packages
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +12 to +45
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

To resolve this issue, you should add an explicit permissions block to the workflow (or to the relevant job, if you want finer control). In this workflow, the safest minimal permissions can be set with contents: read, which allows jobs to check out code but not to write to repository contents. Insert the permissions block either at the root of the workflow file (to apply to all jobs), or just under the build: job definition. The recommended convention is to apply this at the top level, immediately after the name: and before the on: block. No imports or external dependencies are needed; this is a one-line YAML edit.

Suggested changeset 1
.github/workflows/live-share-test-usage.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/live-share-test-usage.yaml b/.github/workflows/live-share-test-usage.yaml
--- a/.github/workflows/live-share-test-usage.yaml
+++ b/.github/workflows/live-share-test-usage.yaml
@@ -1,4 +1,6 @@
 name: Test Usage of Live Share SDK packages in different JS environments
+permissions:
+    contents: read
 
 on:
     push:
EOF
@@ -1,4 +1,6 @@
name: Test Usage of Live Share SDK packages in different JS environments
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment