Skip to content

Conversation

mishig25
Copy link

No description provided.

Comment on lines +12 to +18
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@llms-txt
with:
commit_sha: ${{ github.event.pull_request.head.sha }}
pr_number: ${{ github.event.number }}
package: accelerate
custom_container: huggingface/transformers-doc-builder
doc_builder_revision: llms-txt

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: {}

Copilot Autofix

AI 14 days ago

To fix the problem, we should explicitly set the permissions key in the workflow file. To minimize privilege escalation risks, set permissions to read-all (or more strictly, explicitly enumerate only those access categories required, but without documentation of needs for the imported workflow, contents: read is usually the safest, minimally disruptive setting). This setting can be applied at the workflow root (top of the file, affects all jobs) or at the specific job invocation; for clarity and safety, we recommend setting it at the workflow root unless a job has special needs. For this file, add the following at line 2 (after name:):

permissions:
  contents: read

This restricts the GitHub Actions GITHUB_TOKEN to have only read access to repository contents during workflow runs.

No extra imports, method or variable definitions are needed for a YAML workflow file.


Suggested changeset 1
.github/workflows/build_pr_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/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml
--- a/.github/workflows/build_pr_documentation.yml
+++ b/.github/workflows/build_pr_documentation.yml
@@ -1,4 +1,6 @@
 name: Build PR Documentation
+permissions:
+  contents: read
 
 on:
   pull_request:
EOF
@@ -1,4 +1,6 @@
name: Build PR Documentation
permissions:
contents: read

on:
pull_request:
Copilot is powered by AI and may make mistakes. Always verify output.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants