An `echo X=… >> $GITHUB_ENV` inside a shell `if` branch is taken as unconditional, and later steps with `if: env.X != …` are dropped silently
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
The bug is in project_validator/ci/github_actions.py: _exported (around lines 139-145) records every echo NAME=value >> $GITHUB_ENV without checking the shell if around it, and the step-skip check near lines 268-270 drops steps whose if: depends on that value. Start by reproducing with the small workflow described in the issue and run --facts on it. Done means a step whose if: depends on a conditionally exported variable is either evaluated correctly or recorded as unknown rather than silently skipped, with a test covering it.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
zigtools/zls: a step sets SKIP_DEPLOY=true in $GITHUB_ENV only inside an if branch; the validator records the assignment unconditionally, every later step guarded by if: env.SKIP_DEPLOY != 'true' is dropped with no ERROR, and the zig build release -Doptimize=ReleaseSafe build is never seen (hardening FAIL "no ReleaseSafe build", ci-build-types "missing Release"). A value set under a condition is unknown; a step whose if: depends on it should be read (or recorded as unknown), not dropped.
Evidence from the corpus audit
zigtools/zls / hardening (also ci-build-types)
- kind: FALSE_NEGATIVE
- actual: FAIL: release builds drop Zig's safety checks: no ReleaseSafe build (ci-build-types: "linux / master: missing
... Release") - expected: PASS: the release workflow builds with
-Doptimize=ReleaseSafe. - evidence:
.github/workflows/artifacts.yml:23:if: github.event_name == 'schedule'(the step that may export);
:32:echo "SKIP_DEPLOY=true" >> $GITHUB_ENV(insideif [ -n "$(git tag --points-at HEAD)" ]; then);
:61:if: env.SKIP_DEPLOY != 'true';:64:zig build release -Drelease-minisign -Doptimize=ReleaseSafe --summary all.
Validator:project_validator/ci/github_actions.py:139-145(_exportedtakes everyecho NAME=value >> $GITHUB_ENV
in the script, ignoring the shellifit sits in and the step's own unknownif:);:259-261merges it into
known.env;:268-270runs = self.runs(step.get("if"), known); if runs is False: returndrops the step with no
fact and no "not read".--factsconfirms: artifacts.yml yields facts for steps[0..1] only; no ActionStep for
mlugg/setup-zig, no Command for step 7. - repro:
.github/workflows/r.yml: job with stepsrun: |\n if [ -n "$X" ]; then\n echo "SKIP=true" >> $GITHUB_ENV\n fi
then- uses: mlugg/setup-zig@v2\n if: env.SKIP != 'true'then- run: zig build -Doptimize=ReleaseSafe\n if: env.SKIP != 'true';
build.zigwithaddExecutable. Reproduced in
<scratch>/audit/repro-hard-githubenv
(FAIL; the same workflow without the export PASSes). - confidence: high
Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- Python
- Star
- 4
- Fork
- 1
- Merge trung bình
- 10 giờ 41 phút
- Pull request đã merge (30 ngày)
- 79
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cpp-best-practices/project_validator
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
cpp-best-practices/project_validator#267 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
cpp-best-practices/project_validator#263 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
cpp-best-practices/project_validator#260 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
cpp-best-practices/project_validator#259 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
cpp-best-practices/project_validator#255 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cpp-best-practices/project_validator
Issue tương tự
-
plot_graph crashes when a mesh node has no m2m edgeCó thể đã có người làm @tygvi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mllam/neural-lam#883 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement possible-duplicate
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/PictoPy#1715 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
SQLite connector omits generated columns from the catalog, and drops relationships sourced on themĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NVIDIA/auto-ontology#511 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ethereum/execution-specs#3996 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Project-N-E-K-O/N.E.K.O#3725 ·
Maintainer thường phản hồi trong vòng 1 ngày