Skip to content
Draft
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
26 changes: 26 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Documentation Tests'

on:
pull_request:
paths:
- 'docs/**'
- 'docs-mslearn/**'
- 'docs-wiki/**'
- '*.md'
- 'src/**/*.md'

jobs:
broken_links:
name: Broken Links
runs-on: Windows-latest
steps:
- name: Install and cache PowerShell modules
uses: potatoqualitee/[email protected]
with:
modules-to-cache: Pester
shell: pwsh
- uses: actions/checkout@v3
- name: Run Broken Links Test
shell: pwsh
run: |
src/scripts/Test-PowerShell.ps1 -Markdown
Comment on lines +14 to +26

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium documentation

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 4 months ago

To fix the issue, we will add a permissions block to the root of the workflow file. This block will specify the least privileges required for the workflow to function. Since the workflow only needs to read the repository contents to check for broken links, we will set contents: read. This ensures that the workflow has no write access to the repository.

The permissions block will be added at the root level, applying to all jobs in the workflow.


Suggested changeset 1
.github/workflows/documentation.yml

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/documentation.yml b/.github/workflows/documentation.yml
--- a/.github/workflows/documentation.yml
+++ b/.github/workflows/documentation.yml
@@ -11,2 +11,5 @@
 
+permissions:
+  contents: read
+
 jobs:
EOF
@@ -11,2 +11,5 @@

permissions:
contents: read

jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
File renamed without changes.
Loading