-
Notifications
You must be signed in to change notification settings - Fork 19
Create release 26.25 and setup automatic GitHub PyPI workflow #58
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: main
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,70 @@ | ||||||||||
| name: Release | ||||||||||
|
|
||||||||||
| on: | ||||||||||
| release: | ||||||||||
| types: [published] | ||||||||||
| workflow_dispatch: {} | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| build-sdist: | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| steps: | ||||||||||
| - uses: actions/checkout@v4 | ||||||||||
|
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. 🧩 Analysis chain🏁 Script executed: find . -name "release.yml" -type f | head -20Repository: TeskaLabs/cysimdjson Length of output: 96 🏁 Script executed: cat -n ./.github/workflows/release.ymlRepository: TeskaLabs/cysimdjson Length of output: 2261 🌐 Web query:
💡 Result: In GitHub Actions, the Citations:
Disable credential persistence in checkout steps. Lines 12 and 31 should set Suggested hardening- - uses: actions/checkout@v4
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[warning] 12-12: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 12-12: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools 🧩 Analysis chain🏁 Script executed: find . -name "release.yml" -path ".github/workflows/*" | head -5Repository: TeskaLabs/cysimdjson Length of output: 46 🏁 Script executed: cat -n .github/workflows/release.yml | head -80Repository: TeskaLabs/cysimdjson Length of output: 2261 🏁 Script executed: # Get the specific lines mentioned in the review
sed -n '10,15p; 22,25p; 30,33p; 42,45p; 48,51p; 62,65p; 68,71p' .github/workflows/release.ymlRepository: TeskaLabs/cysimdjson Length of output: 731 🌐 Web query:
💡 Result: Pinning GitHub Actions to a full-length commit SHA is a foundational security best practice designed to mitigate software supply chain risks [1][2]. Why Pinning to a Commit SHA is Necessary By default, referencing an action via a version tag (e.g., Citations:
🌐 Web query:
💡 Result: Using mutable tags (e.g., Citations:
Pin all GitHub Actions to immutable commit SHAs. Lines 12, 14, 23, 31, 43, 49, 64, and 70 use mutable tags ( Suggested hardening- - uses: actions/checkout@v4
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- - uses: actions/setup-python@v5
+ - uses: actions/setup-python@0a5c61591373683513f5e40cfe7b3f642cedabf1
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b312597279f63c292
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b312597279f63c292
- - uses: pypa/cibuildwheel@v2
+ - uses: pypa/cibuildwheel@905e1b537dc9d2969307c0bcf5483ad80dfaddf7
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b312597279f63c292
- - uses: actions/download-artifact@v4
+ - uses: actions/download-artifact@a6d2e45e43b3d4e3f3f6ca5f3d24f3e7f0a6d5a5
- - uses: pypa/gh-action-pypi-publish@release/v1
+ - uses: pypa/gh-action-pypi-publish@8f42f746e5e1a9c1cd5f05a4d6cf5e8f7d6e4e5eConsider automating SHA updates with Dependabot or Renovate to sustain this hardening. 🧰 Tools🪛 zizmor (1.25.2)[warning] 12-12: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 12-12: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||
|
|
||||||||||
| - uses: actions/setup-python@v5 | ||||||||||
| with: | ||||||||||
| python-version: "3.12" | ||||||||||
|
|
||||||||||
| - name: Build sdist | ||||||||||
| run: | | ||||||||||
| python -m pip install --upgrade pip build | ||||||||||
| python -m build --sdist | ||||||||||
|
|
||||||||||
| - uses: actions/upload-artifact@v4 | ||||||||||
| with: | ||||||||||
| name: sdist | ||||||||||
| path: dist/*.tar.gz | ||||||||||
|
|
||||||||||
| build-wheels: | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| steps: | ||||||||||
| - uses: actions/checkout@v4 | ||||||||||
|
|
||||||||||
| - name: Verify version matches release tag | ||||||||||
| if: github.event_name == 'release' | ||||||||||
| run: | | ||||||||||
| VERSION=$(sed -n "s/^[[:space:]]*version=[\"']\\([^\"']*\\)[\"'].*/\\1/p" setup.py) | ||||||||||
| TAG="${GITHUB_REF_NAME#v}" | ||||||||||
| if [ "$VERSION" != "$TAG" ]; then | ||||||||||
| echo "setup.py version ($VERSION) does not match tag ($TAG)" | ||||||||||
| exit 1 | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| - uses: pypa/cibuildwheel@v2 | ||||||||||
| env: | ||||||||||
| CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-* | ||||||||||
| CIBW_SKIP: "*-musllinux_*" | ||||||||||
| CIBW_ARCHS_LINUX: x86_64 | ||||||||||
|
|
||||||||||
| - uses: actions/upload-artifact@v4 | ||||||||||
| with: | ||||||||||
| name: wheels | ||||||||||
| path: wheelhouse/*.whl | ||||||||||
|
|
||||||||||
| publish: | ||||||||||
| if: github.event_name == 'release' | ||||||||||
| needs: [build-sdist, build-wheels] | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| environment: | ||||||||||
| name: pypi | ||||||||||
| url: https://pypi.org/p/cysimdjson | ||||||||||
| permissions: | ||||||||||
| id-token: write | ||||||||||
| steps: | ||||||||||
| - uses: actions/download-artifact@v4 | ||||||||||
| with: | ||||||||||
| pattern: "*" | ||||||||||
| merge-multiple: true | ||||||||||
| path: dist | ||||||||||
|
|
||||||||||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: TeskaLabs/cysimdjson
Length of output: 2261
Add explicit least-privilege
permissionsfor build jobs in the release workflow.The
build-sdistandbuild-wheelsjobs lack explicit permission declarations and default to GitHub's broader token permissions. Restrict them tocontents: readonly, which is sufficient for repository checkout and artifact operations.Suggested hardening
name: Release on: release: types: [published] workflow_dispatch: {} + +permissions: + contents: readOr add per-job permissions instead:
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 1-71: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Source: Linters/SAST tools