mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
# Description of Changes This PR mitigates **CVE-2025-8869** (GHSA-4xh5-x5gv-qwph), a high-severity vulnerability in `pip` ≤ 25.2 that allows arbitrary file overwrite via unsafe tar extraction in sdist fallback handling. **What was changed:** - Added environment variables to all GitHub Actions (`pre_commit.yml`, `sync_files.yml`) to **enforce binary-only installs**: - `PIP_ONLY_BINARY=":all:"` - `PIP_DISABLE_PIP_VERSION_CHECK="1"` - Updated multiple `.github/scripts/*.txt` requirements to use Python 3.12 as the generation base. - Upgraded pinned dependencies to latest secure versions: - `filelock 3.19.1`, `identify 2.6.15`, `platformdirs 4.4.0`, `pyyaml 6.0.3`, `behave 1.3.3`, `pypdf 6.1.1`, `reportlab 4.4.4`, `requests 2.32.5` - Adjusted file path formatting (`\` → `/`) for consistent cross-platform compatibility. **Why the change was made:** To prevent exploitation of the tar extraction vulnerability in vulnerable pip versions when installing from source distributions during CI runs. --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details.
123 lines
4.8 KiB
YAML
123 lines
4.8 KiB
YAML
name: Sync Files
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "build.gradle"
|
|
- "README.md"
|
|
- "app/core/src/main/resources/messages_*.properties"
|
|
- "app/core/src/main/resources/static/3rdPartyLicenses.json"
|
|
- "scripts/ignore_translation.toml"
|
|
|
|
# cancel in-progress jobs if a new job is triggered
|
|
# This is useful to avoid running multiple builds for the same branch if a new commit is pushed
|
|
# or a pull request is updated.
|
|
# It helps to save resources and time by ensuring that only the latest commit is built and tested
|
|
# This is particularly useful for long-running jobs that may take a while to complete.
|
|
# The `group` is set to a combination of the workflow name, event name, and branch name.
|
|
# This ensures that jobs are grouped by the workflow and branch, allowing for cancellation of
|
|
# in-progress jobs when a new commit is pushed to the same branch or a new pull request is opened.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
sync-files:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
# Prevents sdist builds → no tar extraction
|
|
PIP_ONLY_BINARY: ":all:"
|
|
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
|
|
- name: Setup GitHub App Bot
|
|
id: setup-bot
|
|
uses: ./.github/actions/setup-bot
|
|
with:
|
|
app-id: ${{ secrets.GH_APP_ID }}
|
|
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
|
|
with:
|
|
python-version: "3.12"
|
|
cache: "pip" # caching pip dependencies
|
|
|
|
- name: Sync translation property files
|
|
run: |
|
|
python .github/scripts/check_language_properties.py --reference-file "app/core/src/main/resources/messages_en_GB.properties" --branch main
|
|
|
|
- name: Commit translation files
|
|
run: |
|
|
git add app/core/src/main/resources/messages_*.properties
|
|
git diff --staged --quiet || git commit -m ":memo: Sync translation files" || echo "No changes detected"
|
|
|
|
- name: Install dependencies
|
|
# Wheels-only + Hash-Pinning
|
|
run: |
|
|
pip install --require-hashes --only-binary=:all: -r ./.github/scripts/requirements_sync_readme.txt
|
|
|
|
- name: Sync README.md
|
|
run: |
|
|
python scripts/counter_translation.py
|
|
|
|
- name: Run git add
|
|
run: |
|
|
git add README.md scripts/ignore_translation.toml
|
|
git diff --staged --quiet || git commit -m ":memo: Sync README.md & scripts/ignore_translation.toml" || echo "No changes detected"
|
|
|
|
- name: Create Pull Request
|
|
if: always()
|
|
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
|
with:
|
|
token: ${{ steps.setup-bot.outputs.token }}
|
|
commit-message: Update files
|
|
committer: ${{ steps.setup-bot.outputs.committer }}
|
|
author: ${{ steps.setup-bot.outputs.committer }}
|
|
signoff: true
|
|
branch: sync_readme
|
|
title: ":globe_with_meridians: Sync Translations + Update README Progress Table"
|
|
body: |
|
|
### Description of Changes
|
|
|
|
This Pull Request was automatically generated to synchronize updates to translation files and documentation. Below are the details of the changes made:
|
|
|
|
#### **1. Synchronization of Translation Files**
|
|
- Updated translation files (`messages_*.properties`) to reflect changes in the reference file `messages_en_GB.properties`.
|
|
- Ensured consistency and synchronization across all supported language files.
|
|
- Highlighted any missing or incomplete translations.
|
|
|
|
#### **2. Update README.md**
|
|
- Generated the translation progress table in `README.md`.
|
|
- Added a summary of the current translation status for all supported languages.
|
|
- Included up-to-date statistics on translation coverage.
|
|
|
|
#### **Why these changes are necessary**
|
|
- Keeps translation files aligned with the latest reference updates.
|
|
- Ensures the documentation reflects the current translation progress.
|
|
|
|
---
|
|
|
|
Auto-generated by [create-pull-request][1].
|
|
|
|
[1]: https://github.com/peter-evans/create-pull-request
|
|
draft: false
|
|
delete-branch: true
|
|
labels: github-actions
|
|
sign-commits: true
|
|
add-paths: |
|
|
README.md
|
|
app/core/src/main/resources/messages_*.properties
|