Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Scope GITHUB_TOKEN permissions per job (#4982)
A job with no `permissions:` block inherits whatever the repository
hands out. Each block added here grants what that job's own steps
need and nothing more.

Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>
  • Loading branch information
hf-security-analysis[bot] authored Sep 23, 2026
commit da5e2441d56a1967db68833fccd2af0679049d57
8 changes: 6 additions & 2 deletions .github/workflows/check-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ on:
- ".github/workflows/check-installers.yml"
workflow_dispatch: {}

permissions:
contents: read

permissions: {}

jobs:
linux-installer:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -61,6 +63,8 @@ jobs:
rm -rf "$HF_TEST_ROOT"

windows-installer:
permissions:
contents: read
runs-on: windows-latest
steps:
- name: Checkout repository
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/model_card_consistency_reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ on:
- src/huggingface_hub/templates/modelcard_template.md
- src/huggingface_hub/templates/datasetcard_template.md

permissions: {}

jobs:
comment:
permissions: {}
runs-on: ubuntu-latest
steps:
- name: Create GitHub App token
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/python-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ on:
- "js/**"
- "api-inference-community/**"

permissions: {}

jobs:
check_code_quality:
permissions:
contents: read
runs-on: ubuntu-latest
env:
UV_HTTP_TIMEOUT: 600 # max 10min to install deps
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
check-imports:
permissions:
contents: read
# Catch missing dependencies: install only base requirements and verify all public imports work.
runs-on: ubuntu-latest
steps:
Expand All @@ -38,6 +42,8 @@ jobs:
python utils/check_imports.py

build-ubuntu:
permissions:
contents: read
runs-on:
group: aws-general-8-plus
# A healthy full-suite job takes ~20min. Anything much longer means something is stuck: fail fast instead of
Expand Down Expand Up @@ -157,6 +163,8 @@ jobs:
verbose: true

build-windows:
permissions:
contents: read
# (almost) Duplicate config compared to `build-ubuntu` but running on Windows.
# Please make sure to keep it updated as well.
runs-on: windows-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ on:
- minor-release
- patch-release


permissions: {}

jobs:
Expand Down Expand Up @@ -1269,6 +1270,7 @@ jobs:
# 9. SLACK — final status update
# ============================================================
slack-complete:
permissions: {}
needs: [prepare, publish-pypi, publish-hf-cli, release-notes, slack-message, archive-release-notes, test-downstream, post-release, sync-hf-cli-skill, notify-prs]
if: ${{ always() && needs.prepare.outputs.message_ts }}
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/style-bot-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ on:
required: true
description: "GitHub App private key used to generate a short-lived token"

permissions: {}

jobs:
check-permissions:
permissions:
contents: read
if: >
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, '@bot /style') &&
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/trufflehog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ on:

name: Secret Leaks

permissions: {}

jobs:
trufflehog:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update-inference-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ concurrency:
group: update-inference-types
cancel-in-progress: true

permissions: {}

jobs:
pull_request:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
# Setup Python
Expand Down
Loading