LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
[MISC] Give GitHub workflows least-privilege token permissions (#2396)
Ritwik G255f0d39fd9b
diff --git a/.github/workflows/ci-frontend-lint.yaml b/.github/workflows/ci-frontend-lint.yamlindex 7131ecf9c..8dc81bfe5 100644--- a/.github/workflows/ci-frontend-lint.yaml+++ b/.github/workflows/ci-frontend-lint.yaml@@ -14,6 +14,10 @@ on:types: [opened, synchronize, reopened, ready_for_review]branches: [main]+# The repo default token is write; grant only what each job needs.+permissions:+ contents: read+jobs:# Gating jobs below run when `changes` finds frontend files, AND whenever# `changes` itself did not succeed: a skipped job satisfies a required@@ -22,6 +26,10 @@ jobs:changes:if: github.event.pull_request.draft == falseruns-on: ubuntu-latest+ permissions:+ contents: read+ # dorny/paths-filter lists PR files via the API.+ pull-requests: readoutputs:# Push is already path-filtered by its trigger, so force true off-PR.frontend: ${{ github.event_name != 'pull_request' || steps.filter.outputs.frontend == 'true' }}@@ -44,10 +52,16 @@ jobs:needs: changesif: ${{ !cancelled() && github.event.pull_request.draft != true && (needs.changes.result != 'success' || needs.changes.outputs.frontend == 'true') }}runs-on: ubuntu-latest+ permissions:+ contents: read+ # marocchino/sticky-pull-request-comment posts the lint report.+ pull-requests: writesteps:- name: Checkout repositoryuses: actions/checkout@v6+ with:+ persist-credentials: false- name: Setup Biomeuses: biomejs/setup-biome@4c91541eaada48f67d7dbd7833600ce162b68f51 # v2.7.1@@ -107,6 +121,8 @@ jobs:steps:- name: Checkout repositoryuses: actions/checkout@v6+ with:+ persist-credentials: false- name: Setup Bunuses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0@@ -131,6 +147,8 @@ jobs:steps:- name: Checkout repositoryuses: actions/checkout@v6+ with:+ persist-credentials: false- name: Setup Bunuses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0diff --git a/.github/workflows/ci-test.yaml b/.github/workflows/ci-test.yamlindex 8509f496b..dc7960897 100644--- a/.github/workflows/ci-test.yaml+++ b/.github/workflows/ci-test.yaml@@ -19,6 +19,10 @@ on:- mainworkflow_dispatch:+# The repo default token is write; grant only what each job needs.+permissions:+ contents: read+jobs:# Path filtering at job level, not trigger paths-ignore: an untriggered# workflow reports no check run, so a required check waits forever; a job@@ -28,6 +32,10 @@ jobs:# and docker/** changes must be e2e-tested.changes:runs-on: ubuntu-latest+ permissions:+ contents: read+ # dorny/paths-filter lists PR files via the API.+ pull-requests: readoutputs:# Filtering is a PR-time saving only. On workflow_dispatch there is no# base to diff, so paths-filter resolves against the default branch and a@@ -270,6 +278,10 @@ jobs:# from a real tier failure.if: always() && github.event.pull_request.draft == falseruns-on: ubuntu-latest+ permissions:+ contents: read+ # marocchino/sticky-pull-request-comment posts the test report.+ pull-requests: writesteps:- name: Checkout repositoryuses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3diff --git a/.github/workflows/docker-tools-build-push.yaml b/.github/workflows/docker-tools-build-push.yamlindex dc1173b82..3e186978e 100644--- a/.github/workflows/docker-tools-build-push.yaml+++ b/.github/workflows/docker-tools-build-push.yaml@@ -24,6 +24,11 @@ on:run-name: "[${{ inputs.service_name }}:${{ inputs.tag }}] Docker Image Build and Push (Development)"+# The repo default token is write. The image goes to Docker Hub via secrets,+# so the token is only used to check out.+permissions:+ contents: read+jobs:build-and-push:runs-on: ubuntu-latest@@ -33,6 +38,8 @@ jobs:- name: Checkout codeuses: actions/checkout@v6+ with:+ persist-credentials: false# Set up QEMU for ARM64 emulation- name: Set up QEMUdiff --git a/.github/workflows/production-build.yaml b/.github/workflows/production-build.yamlindex b91d35b33..63d842936 100644--- a/.github/workflows/production-build.yaml+++ b/.github/workflows/production-build.yaml@@ -18,6 +18,11 @@ on:run-name: "[${{ github.event.release.tag_name || github.event.inputs.tag }}] Docker Image Build and Push (Production)"+# The repo default token is write. Docker Hub and Slack are reached via+# secrets, so the token only reads: checkout and `gh release list`.+permissions:+ contents: read+jobs:# Validates tag format and version monotonicity within the same major.minor line.# This guards the workflow_dispatch tag input and any release event.@@ -112,10 +117,13 @@ jobs:uses: actions/checkout@v6with:ref: ${{ github.event.release.tag_name }}+ persist-credentials: false- name: Checkout code for branchif: github.event_name != 'release'uses: actions/checkout@v6+ with:+ persist-credentials: false# Set up QEMU for ARM64 emulation- name: Set up QEMUdiff --git a/.github/workflows/release-notification.yaml b/.github/workflows/release-notification.yamlindex f22e83285..cf5d23882 100644--- a/.github/workflows/release-notification.yaml+++ b/.github/workflows/release-notification.yaml@@ -4,6 +4,9 @@ on:release:types: [created]+# Posts to a Slack incoming webhook (a secret); never uses the GITHUB_TOKEN.+permissions: {}+jobs:notify-slack:runs-on: ubuntu-latest