Repository navigation
Set up reproducible paper builds and repository security #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a6b4aab
62412c5
04c016b
7305478
bf0e33c
06943d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json | ||
| language: en-US | ||
| reviews: | ||
| profile: chill | ||
| auto_approvals: | ||
| enabled: true | ||
| max_merge_risk: low | ||
| # max_security_risk requires Advanced; the current plan is Essentials. | ||
| overrides: | ||
| - enabled: false | ||
| paths: | ||
| - '.github/**' | ||
|
Comment on lines
+9
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔎 Supported by static analysis
Make approval policy changes in
Protect this file with a control that the PR cannot change. Options include:
|
||
| high_level_summary_in_walkthrough: true | ||
| review_status: true | ||
| # Publish the commit status required by the main ruleset, as in Delaunay. | ||
| review_progress: false | ||
| commit_status: true | ||
| fail_commit_status: true | ||
| poem: false | ||
| auto_review: | ||
| enabled: true | ||
| auto_incremental_review: true | ||
| drafts: true | ||
| path_filters: | ||
| - '!**/*.pdf' | ||
| - '!**/*.png' | ||
| - '!**/*.vsd' | ||
| - '!target/**' | ||
| - '!uv.lock' | ||
| path_instructions: | ||
| - path: '**/*.tex' | ||
| instructions: >- | ||
| Preserve author-owned manuscript prose, scientific claims, attribution, | ||
| captions, and TODOs. Review mechanical LaTeX correctness, references, | ||
| bibliography and figure paths, and build reproducibility. Give critique | ||
| rather than replacement publication prose. | ||
| - path: '.github/**' | ||
| instructions: >- | ||
| Check least-privilege permissions, pinned and allowlisted actions, | ||
| untrusted PR input handling, required-check names, and cleanup after | ||
| failed builds. PDF build outputs must not be committed or uploaded. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| * text=auto | ||
| *.bib text eol=lf | ||
| *.md text eol=lf | ||
| *.py text eol=lf | ||
| *.sh text eol=lf | ||
| *.tex text eol=lf | ||
| *.toml text eol=lf | ||
| *.yml text eol=lf | ||
| justfile text eol=lf | ||
| *.pdf binary | ||
| *.png binary | ||
|
|
||
| # Preserve historical manuscript and calculation bytes across checkout platforms. | ||
| agent-based-modeling/** -text | ||
| cdt-newtonian-limit/** -text | ||
| cdt-survey/** -text | ||
| efficient-cdt/** -text | ||
| higgs/** -text | ||
| ligo/** -text | ||
| local-global-flatness/** -text | ||
| newtonian-derivation-cdt/** -text | ||
| orions-arm-wormholes/** -text | ||
| shared/bibliography/** -text | ||
| traversable-wormholes/** -text | ||
| weyl-metric-calculations/** -text | ||
| docs/legacy-catalog.txt -text |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Human review covers approval policy and GitHub controls, including this file. | ||
| /.coderabbit.yaml @acgetchell | ||
| /.coderabbit.yml @acgetchell | ||
| /.github/** @acgetchell |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| blank_issues_enabled: true | ||
| contact_links: | ||
| - name: Report a security vulnerability privately | ||
| url: https://github.com/acgetchell/Papers/security/advisories/new | ||
| about: Use private vulnerability reporting for security-sensitive build or tooling issues. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Remove when actionlint supports self-repository references: | ||
| # https://github.com/rhysd/actionlint/issues/711 | ||
| paths: | ||
| .github/workflows/*.yml: | ||
| ignore: | ||
| - '^specifying action "\$/\.github/actions/setup-just" in invalid format because ref is missing\.' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Set up shared tooling | ||
| description: Install the locked published package and declared base tools. | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install declared uv | ||
| uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0 | ||
| with: | ||
| version-file: pyproject.toml | ||
| enable-cache: false | ||
|
|
||
| - name: Cache managed tools | ||
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | ||
| with: | ||
| path: ~/.cache/research-repo-tools | ||
| key: managed-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pyproject.toml','rust-toolchain.toml','.python-version','tooling/papers.toml') }} | ||
| restore-keys: managed-tools-${{ runner.os }}-${{ runner.arch }}- | ||
|
|
||
| - name: Install the locked tooling package | ||
| shell: bash | ||
| run: uv sync --locked --managed-python --only-group tooling | ||
|
|
||
| - name: Install verified release binaries | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: uv run --locked --no-sync --no-python-downloads research-repo-tools toolchain sync-binaries | ||
|
|
||
| - name: Install and export declared base tools | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| uv run --locked --managed-python --only-group tooling research-repo-tools toolchain sync | ||
| uv sync --locked --managed-python --group dev --group papers | ||
| uv run --locked --no-sync --no-python-downloads research-repo-tools toolchain export |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| cooldown: | ||
| default-days: 7 | ||
| groups: | ||
| actions: | ||
| patterns: ['*'] | ||
| - package-ecosystem: uv | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| cooldown: | ||
| default-days: 7 | ||
| groups: | ||
| python: | ||
| patterns: ['*'] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "github_owned_allowed": false, | ||
| "verified_allowed": false, | ||
| "patterns_allowed": [ | ||
| "actions/cache@*", | ||
| "actions/checkout@*", | ||
| "actions/upload-artifact@*", | ||
| "astral-sh/setup-uv@*", | ||
| "github/codeql-action/analyze@*", | ||
| "github/codeql-action/init@*", | ||
| "github/codeql-action/upload-sarif@*" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "name": "main", | ||
| "target": "branch", | ||
| "enforcement": "active", | ||
| "bypass_actors": [ | ||
| {"actor_id": 5, "actor_type": "RepositoryRole", "bypass_mode": "always"} | ||
| ], | ||
| "conditions": { | ||
| "ref_name": {"include": ["~DEFAULT_BRANCH"], "exclude": []} | ||
| }, | ||
| "rules": [ | ||
| {"type": "deletion"}, | ||
| {"type": "non_fast_forward"}, | ||
| { | ||
| "type": "pull_request", | ||
| "parameters": { | ||
| "allowed_merge_methods": ["merge", "squash", "rebase"], | ||
| "dismiss_stale_reviews_on_push": true, | ||
| "require_code_owner_review": true, | ||
| "require_last_push_approval": false, | ||
| "required_approving_review_count": 1, | ||
| "required_review_thread_resolution": true | ||
| } | ||
| }, | ||
| { | ||
| "type": "required_status_checks", | ||
| "parameters": { | ||
| "do_not_enforce_on_create": true, | ||
| "strict_required_status_checks_policy": true, | ||
| "required_status_checks": [ | ||
| {"context": "Tooling validation", "integration_id": 15368}, | ||
| {"context": "Gitleaks secret scan", "integration_id": 15368}, | ||
| {"context": "OSV dependency scan", "integration_id": 15368}, | ||
| {"context": "GitHub Actions Security Analysis", "integration_id": 15368}, | ||
| {"context": "Changed paper builds", "integration_id": 15368}, | ||
| {"context": "CodeRabbit", "integration_id": 347564} | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "allow_auto_merge": true | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| tooling: | ||
| name: Tooling validation | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: $/.github/actions/setup-just | ||
| - name: Validate active tooling and pinned inputs | ||
| run: just ci |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: CodeQL | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: '38 11 * * 6' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| concurrency: | ||
| group: codeql-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: [actions, python] | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| queries: security-extended | ||
| - name: Analyze source and workflows | ||
| uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3 | ||
| with: | ||
| category: /language:${{ matrix.language }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Gitleaks | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: '30 6 * * 1' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: gitleaks-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| scan: | ||
| name: Gitleaks secret scan | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| - uses: $/.github/actions/setup-just | ||
| - name: Scan reachable history and current files | ||
| id: scan | ||
| run: just security-secrets | ||
| - name: Retain redacted security reports | ||
| if: ${{ !cancelled() && steps.scan.outcome != 'skipped' }} | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | ||
| with: | ||
| name: gitleaks-reports | ||
| path: target/security/gitleaks-* | ||
| if-no-files-found: error | ||
| retention-days: 7 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: OSV-Scanner | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: '15 6 * * 1' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: osv-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| scan: | ||
| name: OSV dependency scan | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: $/.github/actions/setup-just | ||
| - name: Audit the root Python lockfile | ||
| id: scan | ||
| run: just security-osv | ||
| - name: Retain dependency scan reports | ||
| if: ${{ !cancelled() && steps.scan.outcome != 'skipped' }} | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | ||
| with: | ||
| name: osv-reports | ||
| path: target/security/osv-* | ||
| if-no-files-found: error | ||
| retention-days: 7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔎 Supported by static analysis
Script executed:
Repository: acgetchell/Papers
Length of output: 5006
Script executed:
Repository: acgetchell/Papers
Length of output: 1884
Web query:
site:docs.coderabbit.ai auto_approvals max_merge_risk max_security_risk approval required reviewResult:
Web query:
https://coderabbit.ai/integrations/schema.v2.json auto_approvals max_merge_risk max_security_risk omitted defaultsResult:
Web query:
site:www.coderabbit.ai/integrations/schema.v2.json "max_merge_risk" "max_security_risk" "auto_approvals"]Result:
Script executed:
Repository: acgetchell/Papers
Length of output: 7261
Do not enable unrestricted automatic approvals.
Unless another CodeRabbit configuration source sets limits, omitting
max_merge_riskandmax_security_riskleaves both limits unrestricted. The automatic approval applies to.github/**, and the main ruleset requires only one approving review. CodeRabbit's approval can therefore satisfy the required review for security-sensitive changes.Set explicit risk ceilings and disable automatic approval for
.github/**.Example restrictive configuration
Committable suggestion