-
Notifications
You must be signed in to change notification settings - Fork 3
updates pre-commit and github action versions #174
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
5131193
0fcd8c1
6743623
a250380
276de83
b39382e
961b158
e15710e
29ea5b2
363293a
bc91b1d
320a13a
76af22e
fe0dc8e
f4fc9d6
f3300e6
59b5f40
d597eac
fdd26f1
1849db5
04bc5a9
885605f
92450b0
4a78125
7e2f703
d2d942e
4cb5a65
51fe17f
8bb3cc0
393ec92
5b7b97a
e16b522
cbe41cc
3bd0a3b
0ee5d8c
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 |
|---|---|---|
|
|
@@ -19,23 +19,20 @@ permissions: | |
|
|
||
| jobs: | ||
| deploy: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.x' | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build | ||
| - name: Build package | ||
| run: python -m build | ||
| - name: Publish package | ||
| uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Build package | ||
| run: uv build | ||
| - name: Publish package | ||
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
Comment on lines
+35
to
+38
Contributor
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 "Changed/workflow files:"
git ls-files '.github/workflows/*' || true
echo
echo "python-publish.yml:"
if [ -f .github/workflows/python-publish.yml ]; then
nl -ba .github/workflows/python-publish.yml | sed -n '1,140p'
else
echo "missing .github/workflows/python-publish.yml"
fi
echo
echo "Search for PYPI_API_TOKEN and python-publish reference:"
rg -n "PYPI_API_TOKEN|gh-action-pypi-publish|pypa|workflow_dispatch|environment:" .github workflows 2>/dev/null || true
echo
echo "Tag/sha check if remote available:"
if command -v gh >/dev/null 2>&1; then
set +e
gh api --method GET -H "Accept: application/vnd.github+json" repos/dh-tech/undate-python/git/ref/heads/feature/updates >/tmp/feature_ref.json 2>/tmp/feature_ref.err || true
cat /tmp/feature_ref.err >&2
gh api -H "Accept: application/vnd.github+json" /tmp/feature_ref.json && true
set -e
echo
tag_ref=$(gh api -H "Accept: application/vnd.github+json" repos/dh-tech/undate-python/git/ref/tags/v1.14.2 2>/tmp/tag_ref.err || cat /tmp/tag_ref.err)
echo "tag_ref=$tag_ref"
gh api -H "Accept: application/vnd.github+json" "repos/dh-tech/undate-python/git/ref/tags/v1.14.2" || true
else
echo "gh not available"
fiRepository: dh-tech/undate-python Length of output: 343 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,180p' .github/workflows/python-publish.yml
echo
echo "Search for publishing inputs/secrets:"
rg -n "PYPI_API_TOKEN|gh-action-pypi-publish|pypa|workflow_dispatch|environment:|permissions:|on:|release|if:" .github/workflows/python-publish.yml .github/workflows 2>/dev/null || trueRepository: dh-tech/undate-python Length of output: 3631 Gate manual publishing and remove the long-lived PyPI token.
🧰 Tools🪛 zizmor (1.28.0)[info] 35-35: prefer trusted publishing for authentication (use-trusted-publishing): this step (use-trusted-publishing) 🤖 Prompt for AI AgentsSource: MCP tools |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,8 @@ | ||||||||||||||
| # Change Log | ||||||||||||||
|
|
||||||||||||||
| ## 0.8 | ||||||||||||||
|
|
||||||||||||||
| - | ||||||||||||||
|
Comment on lines
+3
to
+5
Contributor
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. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Replace the empty placeholder with actual release notes. Line [5] leaves a malformed, content-free changelog entry. Add the 0.8 changes, or omit the bullet until they are ready. Suggested fix ## 0.8
--
+- Document the changes included in the 0.8 development cycle.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| ## 0.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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: dh-tech/undate-python
Length of output: 2189
🌐 Web query:
astral-sh/setup-uv v9.0.0 enable-cache default auto README💡 Result:
In astral-sh/setup-uv v9.0.0, the
enable-cacheinput retains its default value of"auto"[1][2]. This setting enables caching on GitHub-hosted runners and disables it on self-hosted runners [1][3]. The primary change to caching behavior in v9.0.0 was a breaking change to theprune-cacheinput, which now defaults tofalse(previouslytrue) [4][5]. This change was implemented to reduce unnecessary load on PyPI infrastructure by preventing the premature removal of pre-built wheels from the cache [4][6]. Key details regarding caching configuration: -enable-cache: Default is"auto", with options for"true","false", or"auto"[7][1]. -prune-cache: Default is now"false"[4][2]. - Official documentation provides further details on managing cache dependencies and behavior in thedocs/caching.mdfile [8].Citations:
🌐 Web query:
GitHub Actions third-party action cached variables poisoned cache trusted workflows💡 Result:
Cache poisoning in GitHub Actions is a supply-chain attack where an attacker injects malicious content into the shared action cache, which is subsequently executed by a more privileged workflow (such as a release or deployment pipeline) [1][2][3]. Because cache entries are repository-scoped rather than workflow-scoped, they can be read by any workflow triggered on the same branch [1][3]. As of June 26, 2026, GitHub has implemented a significant security mitigation: workflows triggered by untrusted events (e.g., pull_request_target, issue_comment, and fork-PR workflow_run cascades) now receive read-only access to the default-branch cache [4][5]. This prevents these untrusted contexts from overwriting or poisoning cache entries intended for use by trusted workflows like push or schedule [4]. Key security considerations include: 1. Trusted Workflows and Triggers: While the recent read-only change mitigates the most common public-to-private poisoning vectors, trusted workflows themselves remain a risk [5]. If a workflow that has write access to the cache is itself influenced by untrusted inputs (e.g., a workflow on the default branch that checks out untrusted PR code), it can still serve as a vehicle for cache poisoning [6][4][5]. 2. Third-Party Actions: Using third-party actions introduces the risk that a compromised action could manipulate cache writes [7]. All third-party actions should be pinned to a specific commit SHA, not a mutable tag or branch, to prevent attackers from injecting malicious code by re-tagging (e.g., moving a v4 tag) [8][7][9]. 3. Defense-in-Depth: - Segregate Cache Keys: Use distinct prefixes for cache keys based on the trust level of the workflow (e.g., pr- vs. release-) to ensure that PR-triggered workflows cannot overwrite or satisfy the cache keys used by release workflows [5][10][3]. - Disable Caching in Critical Jobs: For highly sensitive jobs like publishing or releases, consider disabling caching entirely or using lookup-only mode to prevent the accidental execution of potentially malicious cached dependencies [5][9][11]. - Audit and Governance: Regularly audit workflows for the use of privileged triggers (pull_request_target) combined with untrusted checkout commands [6][10]. Automated tools and linters (such as CodeQL or custom security policies) can help identify these patterns [10][12][11]. While the June 2026 update addresses the most direct cross-boundary poisoning paths, the fundamental principle remains: treat the cache as an unsigned, potentially untrusted input that should never be implicitly trusted in high-privilege execution contexts [5][9].
Citations:
Disable uv caching in the publishing job.
The release workflow uses
astral-sh/setup-uvwith its defaultenable-cache: auto, which enables caching on GitHub-hosted runners. Keep cache-free for release builds by settingenable-cache: falseexplicitly.🧰 Tools
🪛 zizmor (1.28.0)
[error] 29-29: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
🤖 Prompt for AI Agents
Sources: MCP tools, Linters/SAST tools