Repository navigation
chore: update rhiza to v1.2.5 #25
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
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,63 @@ | ||
| # GitHub Actions Configuration | ||
|
|
||
| This document describes the secrets used by the Rhiza-provided GitHub Actions workflows | ||
| (`.github/workflows/rhiza_*.yml`) and how to configure them. | ||
|
|
||
| ## PAT_TOKEN | ||
|
|
||
| Some workflows may need to push changes to files under `.github/workflows/`. The | ||
| automatic `github.token` **cannot** do that — GitHub rejects such pushes unless | ||
| the token carries the `workflow` scope. If you need it, create a Personal Access | ||
| Token (PAT) with the `workflow` scope and store it as a repository secret named | ||
| `PAT_TOKEN`. | ||
|
|
||
| If `PAT_TOKEN` is not configured, workflows fall back to `github.token`. | ||
|
|
||
| ### Creating the token | ||
|
|
||
| **Fine-grained PAT** (recommended): | ||
|
|
||
| 1. Go to **Settings → Developer settings → Fine-grained tokens → Generate new token** | ||
| (<https://github.com/settings/personal-access-tokens/new>). | ||
| 2. Restrict **Repository access** to the repository (or repositories) using Rhiza. | ||
| 3. Under **Repository permissions**, grant: | ||
| - **Contents**: Read and write | ||
| - **Workflows**: Read and write | ||
| - **Pull requests**: Read and write (needed for the scheduled sync-PR mode) | ||
| 4. Generate the token and copy it. | ||
|
|
||
| **Classic PAT** (alternative): | ||
|
|
||
| 1. Go to **Settings → Developer settings → Tokens (classic) → Generate new token**. | ||
| 2. Select the `repo` and `workflow` scopes. | ||
| 3. Generate the token and copy it. | ||
|
|
||
| ### Storing the secret | ||
|
|
||
| In the repository that consumes Rhiza: | ||
|
|
||
| 1. Go to **Settings → Secrets and variables → Actions → New repository secret**. | ||
| 2. Name: `PAT_TOKEN` | ||
| 3. Value: the token created above. | ||
|
|
||
| Or with the GitHub CLI: | ||
|
|
||
| ```bash | ||
| gh secret set PAT_TOKEN | ||
| ``` | ||
|
|
||
| A PAT expires; when sync pushes start failing with a `refusing to allow ... workflow` error, | ||
| regenerate the token and update the secret. | ||
|
|
||
| ## Release workflow secrets (optional) | ||
|
|
||
| The release workflow (`.github/workflows/rhiza_release.yml`) supports additional secrets, all | ||
| optional depending on which release features you use: | ||
|
|
||
| | Secret | Purpose | | ||
| | --- | --- | | ||
| | `PYPI_TOKEN` | Publish the built package to PyPI. Not needed when using trusted publishing (OIDC). | | ||
| | `GH_PAT` | Git authentication for installing private dependencies during the release build. | | ||
| | `UV_EXTRA_INDEX_URL` | Extra package index URL (with credentials) for private dependencies. | | ||
|
|
||
| `GITHUB_TOKEN` is provided automatically by GitHub Actions and needs no configuration. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| title: "[Help Wanted] " | ||
| labels: ["help wanted"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Use this template to surface a contribution opportunity. It lets maintainers | ||
| describe work that is ready to be picked up — without opening a formal issue. | ||
|
|
||
| - type: input | ||
| id: area | ||
| attributes: | ||
| label: Topic / Area | ||
| description: Which part of the project does this involve? | ||
| placeholder: e.g. CI workflows, documentation, a specific bundle | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: help-needed | ||
| attributes: | ||
| label: What Help Is Needed | ||
| description: Describe the task and what "done" looks like. | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: getting-started | ||
| attributes: | ||
| label: Getting Started | ||
| description: Pointers to relevant files, docs, or prior discussion that help a contributor begin. | ||
| placeholder: | | ||
| - Relevant files: ... | ||
| - Related docs: ... | ||
| validations: | ||
| required: false | ||
|
|
||
| - type: dropdown | ||
| id: skill-level | ||
| attributes: | ||
| label: Skill Level | ||
| description: Roughly how much experience is needed to take this on? | ||
| options: | ||
| - Good first issue (beginner friendly) | ||
| - Intermediate | ||
| - Advanced | ||
| validations: | ||
| required: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| title: "[Idea] " | ||
| labels: ["enhancement"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Propose an idea before implementing it. This lightweight RFC process lets the | ||
| community gauge interest and shape the design before any code is written. | ||
|
|
||
| - type: textarea | ||
| id: idea | ||
| attributes: | ||
| label: The Idea | ||
| description: What are you proposing? Describe it clearly enough that others can react. | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: motivation | ||
| attributes: | ||
| label: Motivation | ||
| description: What problem does this solve, and who benefits? | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: alternatives | ||
| attributes: | ||
| label: Alternatives Considered | ||
| description: Other approaches you weighed, and why this one is preferable. | ||
| validations: | ||
| required: false | ||
|
|
||
| - type: textarea | ||
| id: references | ||
| attributes: | ||
| label: References | ||
| description: Links to prior art, related discussions, issues, or external resources. | ||
| validations: | ||
| required: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,7 @@ updates: | |
| update-types: | ||
| - "patch" | ||
| - "minor" | ||
|
|
||
| commit-message: | ||
| prefix: "chore(deps)" | ||
| include: "scope" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "name": "main-branch-protection", | ||
| "target": "branch", | ||
| "enforcement": "active", | ||
| "conditions": { | ||
| "ref_name": { | ||
| "include": ["~DEFAULT_BRANCH"], | ||
| "exclude": [] | ||
| } | ||
| }, | ||
| "rules": [ | ||
| { "type": "deletion" }, | ||
| { "type": "non_fast_forward" }, | ||
| { | ||
| "type": "pull_request", | ||
| "parameters": { | ||
| "required_approving_review_count": 1, | ||
| "dismiss_stale_reviews_on_push": true, | ||
| "require_code_owner_review": true, | ||
| "require_last_push_approval": true, | ||
| "required_review_thread_resolution": false, | ||
| "allowed_merge_methods": ["squash", "merge", "rebase"] | ||
| } | ||
| }, | ||
| { | ||
| "type": "required_status_checks", | ||
| "parameters": { | ||
| "strict_required_status_checks_policy": false, | ||
| "required_status_checks": [ | ||
| { "context": "Pre-commit hooks", "integration_id": 15368 }, | ||
| { "context": "Check dependencies with deptry", "integration_id": 15368 }, | ||
| { "context": "docs-coverage", "integration_id": 15368 }, | ||
| { "context": "Security scanning", "integration_id": 15368 }, | ||
| { "context": "License compliance scan", "integration_id": 15368 }, | ||
| { "context": "CI gate", "integration_id": 15368 } | ||
| ] | ||
| } | ||
| } | ||
| ], | ||
| "bypass_actors": [ | ||
| { | ||
| "actor_type": "RepositoryRole", | ||
| "actor_id": 5, | ||
| "bypass_mode": "always" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "name": "version-tag-protection", | ||
| "target": "tag", | ||
| "enforcement": "active", | ||
| "conditions": { | ||
| "ref_name": { | ||
| "include": ["refs/tags/v*"], | ||
| "exclude": [] | ||
| } | ||
| }, | ||
| "rules": [ | ||
| { "type": "creation" }, | ||
| { "type": "update" }, | ||
| { "type": "deletion" }, | ||
| { "type": "non_fast_forward" } | ||
| ], | ||
| "bypass_actors": [ | ||
| { | ||
| "actor_type": "RepositoryRole", | ||
| "actor_id": 5, | ||
| "bypass_mode": "always" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,5 +20,5 @@ on: | |
|
|
||
| jobs: | ||
| benchmark: | ||
| uses: jebel-quant/rhiza/.github/workflows/rhiza_benchmark.yml@v0.19.9 | ||
| uses: jebel-quant/rhiza/.github/workflows/rhiza_benchmark.yml@v1.2.5 | ||
| secrets: inherit | ||
|
Comment on lines
+23
to
24
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. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== workflow call sites =="
for f in .github/workflows/rhiza_benchmark.yml .github/workflows/rhiza_book.yml .github/workflows/rhiza_ci.yml .github/workflows/rhiza_codeql.yml .github/workflows/rhiza_fuzzing.yml; do
if [ -f "$f" ]; then
echo "--- $f ---"
nl -ba "$f" | sed -n '1,80p'
else
echo "MISSING $f"
fi
done
echo "== repo-local referenced reusable workflows =="
for f in .github/workflows/rhiza_benchmark.yml .github/workflows/rhiza_book.yml .github/workflows/rhiza_ci.yml .github/workflows/rhiza_codeql.yml .github/workflows/rhiza_fuzzing.yml; do
if [ -f "$f" ]; then
echo "--- referenced by repo $f contains secrets in workflow body? ---"
rg -n "secrets\.|env:|GITHUB_TOKEN|steps:|permissions:" "$f" || true
fi
done
echo "== all workflow uses syntax with inherit/workflows =="
rg -n "uses:\s*jebel-quant/rhiza/.github/workflows/.*`@v1`\.2\.5|secrets:\s*inherit" .github/workflows || true
echo "== git diff stat/name =="
git diff --stat || true
git diff --name-only || trueRepository: tschm/pycharting Length of output: 266 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== location =="
find .github/workflows -maxdepth 1 -type f -printf '%p\n' | sort
echo "== call sites with sed =="
for f in .github/workflows/rhiza_benchmark.yml .github/workflows/rhiza_book.yml .github/workflows/rhiza_ci.yml .github/workflows/rhiza_codeql.yml .github/workflows/rhiza_fuzzing.yml; do
if [ -f "$f" ]; then
echo "--- $f ---"
sed -n '1,100p' "$f"
else
echo "MISSING $f"
fi
done
echo "== reusable workflow uses and callable syntax in files =="
for f in .github/workflows/rhiza_benchmark.yml .github/workflows/rhiza_book.yml .github/workflows/rhiza_ci.yml .github/workflows/rhiza_codeql.yml .github/workflows/rhiza_fuzzing.yml; do
if [ -f "$f" ]; then
echo "--- referenced workflow path in $f ---"
grep -nE 'uses:\s*[^@]+@v1\.2\.5|secrets:\s*inherit|needs\.|on:\s*workflow_call|jobs:\s*|permissions:|env:' "$f" || true
fi
done
echo "== grep inherit/secrets uses in .github/workflows =="
grep -RInE 'uses:\s*jebel-quant/rhiza/.github/workflows/|secrets:\s*inherit' .github/workflows || trueRepository: tschm/pycharting Length of output: 8448 Scope secrets passed to every reusable workflow. All 🧰 Tools🪛 zizmor (1.28.0)[warning] 23-23: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow (secrets-inherit) 📍 Affects 5 files
🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,10 @@ | |
| # It combines API documentation, test coverage reports, test results, and | ||
| # interactive notebooks into a single GitHub Pages site. | ||
| # | ||
| # Trigger: This workflow runs on every push to the main or master branch | ||
| # Trigger: This workflow runs on every push (any branch), so every commit | ||
| # validates that the book still builds. The reusable workflow deploys | ||
| # to GitHub Pages only from the repository's default branch and never | ||
| # from a fork; other branches build and upload an artifact only. | ||
| # | ||
| # Components: | ||
| # - 📓 Process Marimo notebooks | ||
|
|
@@ -19,12 +22,14 @@ name: "(RHIZA) BOOK" | |
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| - '**' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
Comment on lines
+25
to
+28
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. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Files:"
git ls-files | rg '(^|/)\.github/workflows/rhiza_book\.yml$|\.github/workflows/' || true
echo
echo "Target workflow (with line numbers):"
cat -n .github/workflows/rhiza_book.yml || true
echo
callers=$(grep -RIn "\.github/workflows/rhiza_book\.yml@\|github/workflows/rhiza_book\.yml@" .github/workflows || true)
echo
echo "Callers:"
echo "$callers"
echo
echo "Relevant workflow snippets with permissions triggers and usages:"
rg -n "on:|permissions:|pages:|id-token:|secrets:|needs:|uses:|github/workflows/rhiza_book|branches:|branches-ignore:" .github/workflows -S || true
# Read-only parse-ish invariant checks
python3 - <<'PY'
from pathlib import Path
p=Path('.github/workflows/rhiza_book.yml')
text=p.read_text()
lines=text.splitlines()
print("\nParsed-ish checks:")
print("trigger_has_push_branches_star:", any('branches:' in l and "'**'" in l for l in lines))
print("workflow_has_permissions_id_token_write:", any('id-token:' in l and 'write' in l for l in lines))
print("workflow_has_permissions_pages_write:", any('pages:' in l and 'write' in l for l in lines))
calls=[('\n'.join(lines[max(0,i-5):i+5]), i) for i,l in enumerate(lines) if 'uses:' in l and 'rhiza_book.yml' in l]
print("rhiza_book_usage_count:", len(calls))
for chunk,line in calls:
print("at line:", line)
print(chunk)
PYRepository: tschm/pycharting Length of output: 11752 🌐 Web query:
💡 Result: In GitHub Actions, permissions for reusable workflows follow specific rules regarding inheritance and restriction [1][2]. Key points regarding permissions and reusable workflows include: 1. Permission Inheritance and Defaulting: If the permissions key is not specified in the calling job, the called reusable workflow will operate with the default GITHUB_TOKEN permissions [1][3]. 2. Restriction (Downgrading Only): The GITHUB_TOKEN permissions passed from a caller workflow can be downgraded (made more restrictive) by the called workflow, but they cannot be elevated [1][4]. 3. Nested Workflows: In a chain of nested reusable workflows (e.g., A calls B, and B calls C), permissions must be maintained or reduced throughout the chain; they cannot be elevated [2][5]. If workflow A has specific permissions, subsequent workflows (B and C) cannot have broader permissions [1][4]. 4. Configuration: You can use the permissions key at the top level of a workflow or within a specific job (jobs.<job_id>.permissions) to modify these access levels [6][7]. These rules ensure that the GITHUB_TOKEN used by the reusable workflow remains as restrictive as intended by the caller [6]. If you specify permissions within a job, all actions and run commands within that job that use the GITHUB_TOKEN will be limited to those specified rights [6][7]. Citations:
🌐 Web query:
💡 Result: In GitHub Actions, you control the permissions granted to the GITHUB_TOKEN in a reusable workflow using the permissions key [1][2]. When calling a reusable workflow, the caller workflow can specify these permissions within the job that invokes the reusable workflow [3][4][5]. Key points regarding permissions and reusable workflows: 1. How permissions are passed: You define the permissions in the caller workflow using the jobs.<job_id>.permissions key within the job that contains the uses keyword [1][4][2]. 2. Default behavior: If you do not explicitly define jobs.<job_id>.permissions in the calling job, the called reusable workflow will run with the default GITHUB_TOKEN permissions [3][6][5]. 3. Downgrading only: The permissions granted to the GITHUB_TOKEN can be maintained or reduced (downgraded) by the called workflow, but they cannot be elevated [7][3][6][5]. 4. Nested workflows: This restriction on permission elevation applies to the entire chain of reusable workflows [7][3][6][5]. If you have a chain of workflows (e.g., A > B > C), each subsequent workflow must have permissions that are the same as or more restrictive than the preceding one [3][6][5]. Example of passing permissions in a caller workflow: jobs: call-workflow: permissions: contents: read pull-requests: write uses: octo-org/example-repo/.github/workflows/reusable-workflow.yml@main Citations:
🌐 Web query:
💡 Result: In GitHub Actions, reusable workflows interact with caller permissions according to the following rules: 1. Permission Inheritance and Defaulting: If the Citations:
Keep deployment permissions off non-default branch builds. The trigger runs on every pushed branch, but the reusable-workflow job grants 🤖 Prompt for AI Agents |
||
|
|
||
| jobs: | ||
| book: | ||
| uses: jebel-quant/rhiza/.github/workflows/rhiza_book.yml@v0.19.9 | ||
| uses: jebel-quant/rhiza/.github/workflows/rhiza_book.yml@v1.2.5 | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # This file is part of the jebel-quant/rhiza repository | ||
| # (https://github.com/jebel-quant/rhiza). | ||
| # | ||
| # Workflow: ClusterFuzzLite fuzzing | ||
| # | ||
| # Purpose: Run coverage-guided fuzzing for the repository's Python security | ||
| # parsing utilities. Pull requests run short code-change fuzzing, | ||
| # while main-branch pushes and the weekly schedule run batch fuzzing. | ||
| # | ||
| # Opt-in: fuzzing is OFF by default and very optional. Set the | ||
| # repository variable `FUZZING_ENABLED` to 'true' to run it (a | ||
| # .clusterfuzzlite/ config must also be present); otherwise the | ||
| # reusable workflow skips fuzzing (the run stays green). | ||
| # | ||
| # Thin stub: the fuzzing logic lives in the reusable workflow in | ||
| # jebel-quant/rhiza; this file only wires up the triggers. | ||
| # | ||
| # Trigger: Pull requests, pushes to main/master, weekly schedule, and manual | ||
| # dispatch. | ||
|
|
||
| name: "(RHIZA) FUZZING" | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ "main", "master" ] | ||
| push: | ||
| branches: [ "main", "master" ] | ||
| schedule: | ||
| - cron: '17 3 * * 6' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| fuzzing: | ||
| uses: jebel-quant/rhiza/.github/workflows/rhiza_fuzzing.yml@v1.2.5 | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| security-events: write # Upload fuzzing SARIF to code scanning |
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: tschm/pycharting
Length of output: 1998
Pin the Rhiza workflow references to the immutable full commit SHA.
All five callers use the mutable
@v1.2.5tag, so a retagged upstream release can change privileged workflow code. Pin each reference toe5d7005e2d9fc3d5a23b96d13b203b4f2afe3cce..github/workflows/rhiza_benchmark.yml#L23-L23.github/workflows/rhiza_book.yml#L32-L32.github/workflows/rhiza_ci.yml#L29-L29.github/workflows/rhiza_codeql.yml#L29-L29.github/workflows/rhiza_fuzzing.yml#L37-L37🧰 Tools
🪛 zizmor (1.28.0)
[warning] 23-23: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow
(secrets-inherit)
📍 Affects 5 files
.github/workflows/rhiza_benchmark.yml#L23-L23(this comment).github/workflows/rhiza_book.yml#L32-L32.github/workflows/rhiza_ci.yml#L29-L29.github/workflows/rhiza_codeql.yml#L29-L29.github/workflows/rhiza_fuzzing.yml#L37-L37🤖 Prompt for AI Agents