-
Notifications
You must be signed in to change notification settings - Fork 95
Feature/issue 1094 weblate block #1161
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
base: release
Are you sure you want to change the base?
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,33 @@ | ||
| name: Block EN Merges on Active Weblate PRs | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'wiki/en/**' | ||
|
Comment on lines
+4
to
+6
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- workflow ---'
cat -n .github/workflows/check-weblate-prs.yml
printf '%s\n' '--- relevant repository configuration ---'
rg -n -S --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
'Evaluate Weblate PR Status|check-weblate-prs|required status|required check|branch protection|status checks|paths:' \
.github README.md CONTRIBUTING.md docs 2>/dev/null || trueRepository: jamulussoftware/jamuluswebsite Length of output: 1627 🌐 Web query:
💡 Result: <search_synthesis> <source_evidence> Citations:
Do not make this path-filtered workflow a required check.
🤖 Prompt for AI Agents🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- workflow ---'
cat -n .github/workflows/check-weblate-prs.yml
printf '%s\n' '--- related references ---'
rg -n -i --glob '!node_modules' --glob '!dist' 'check-weblate|weblate|branch protection|required status|status check' .github README.md docs 2>/dev/null | head -200Repository: jamulussoftware/jamuluswebsite Length of output: 3969 🌐 Web query:
💡 Result: <search_synthesis> <source_evidence> Citations:
Re-evaluate documentation pull requests when Weblate pull requests change state. This workflow checks only on the affected pull request’s 🤖 Prompt for AI Agents |
||
|
|
||
| jobs: | ||
| check-weblate: | ||
| name: Evaluate Weblate PR Status | ||
| runs-on: ubuntu-24.04-arm | ||
| permissions: | ||
| pull-requests: read | ||
|
|
||
| steps: | ||
| - name: Check for open Weblate pull requests | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| WEBLATE_AUTHOR="weblate" | ||
|
|
||
| echo "Checking $REPO for open PRs from $WEBLATE_AUTHOR..." | ||
|
|
||
| OPEN_PRS=$(gh pr list --repo "$REPO" --state open --author "$WEBLATE_AUTHOR" --json number -q '. | length') | ||
|
|
||
| if [ "$OPEN_PRS" -gt 0 ]; then | ||
| echo "::error::Found $OPEN_PRS open Weblate PR(s). Merging changes to English documentation is blocked to prevent po4a translation conflicts." | ||
| exit 1 | ||
| else | ||
| echo "No open Weblate PRs detected. Safe to proceed." | ||
| exit 0 | ||
| fi | ||
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 | 🛡️ Analyzed with Security Review | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: jamulussoftware/jamuluswebsite
Length of output: 1542
🌐 Web query:
GitHub Actions official documentation pull_request pull_request_target workflow file from base merge commit security💡 Result:
<search_synthesis>
The primary security difference between the pull_request and pull_request_target events in GitHub Actions lies in the context from which the workflow code and repository secrets are accessed, which fundamentally alters the attack surface when dealing with untrusted pull requests [1][2]. pull_request The pull_request event triggers workflows using the code from the pull request&
#39;s merge commit [1]. Because this commit can contain untrusted code from a fork, GitHub enforces strict security boundaries: - The workflow has read-only access to the GITHUB_TOKEN [1][3]. - Access to repository or organization secrets is withheld [1][3]. - This isolation prevents a malicious pull request author from executing code with elevated privileges, a pattern often referred to as a pwn request [4][3]. pull_request_target The pull_request_target event was designed to allow workflows to perform operations that require elevated privileges—such as posting comments, applying labels, or running authenticated checks—on pull requests from forks [1][2]. - Execution Context: The workflow file and any default actions/checkout call (without an explicit ref) are taken from the base repository's default branch, ensuring that only trusted, existing code is executed [1][5]. - Privileges: Because the workflow runs from a trusted source, it is granted a read/write GITHUB_TOKEN and access to repository/organization secrets [1][6]. - Security Risk: While the workflow itself is trusted, it becomes vulnerable if it explicitly checks out and executes untrusted code from the pull request head [4][2]. This is why the event is a high-value target for attackers [7][8]. Recent Security Enhancements GitHub has implemented significant protections to mitigate risks associated with pull_request_target: - Checkout Protections: As of June 2026, the actions/checkout action (v7+) by default refuses to fetch fork pull request code in pull_request_target workflows to prevent accidental execution of untrusted code [4]. To bypass this, a developer must explicitly set allow-unsafe-pr-checkout: true, a deliberate action intended to be easily caught during security reviews [1][4]. - Workflow Integrity: As of November 2025, the workflow file for these events is always taken from the default branch, and GITHUB_REF/GITHUB_SHA resolve to the default branch, preventing the exploitation of outdated or insecure workflows that might exist on other branches [9]. In summary, use pull_request by default. Only use pull_request_target if you strictly require access to secrets or write permissions, and ensure the workflow never executes untrusted code from the pull request head [1][2][8].</search_synthesis>
<source_evidence>
Citations:
Security Misconfiguration
Reachability: External
Exploitability: Moderate
CWE: CWE-693
Run this guard from trusted workflow code.
The
pull_requestevent executes workflow code from the pull request merge commit. A pull request can change this guard and make the check pass. Changepull_requesttopull_request_target; this job does not check out or execute pull request content.🤖 Prompt for AI Agents