Skip to content

fix(ci): harden GitHub Actions workflows (#14607) - #14945

Merged
paulinebm merged 1 commit into
update-tests-fetcher-scriptfrom
security/workflow-hardening/pr-14607
Oct 5, 2026
Merged

paulinebm merged 1 commit into
update-tests-fetcher-scriptfrom
security/workflow-hardening/pr-14607

Conversation

@hf-security-analysis

@hf-security-analysis hf-security-analysis Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Automated hardening of the workflow files flagged on #14607.

Targets update-tests-fetcher-script. Files changed, and what changed them:

  • .github/workflows/pr_test_fetcher.yml — action pins

Fixed by this PR:

  • HIGH unpinned-action (pinact) — .github/workflows/pr_test_fetcher.yml:33
  • HIGH unpinned-action (pinact) — .github/workflows/pr_test_fetcher.yml:55
  • HIGH unpinned-action (pinact) — .github/workflows/pr_test_fetcher.yml:91
  • HIGH unpinned-action (pinact) — .github/workflows/pr_test_fetcher.yml:117
  • HIGH unpinned-action (pinact) — .github/workflows/pr_test_fetcher.yml:146
  • HIGH unpinned-action (pinact) — .github/workflows/pr_test_fetcher.yml:172

This does not fix everything. 3 further finding(s) (3 high) need a decision this bot should not make for you. They are in the security channel with their locations — deliberately not repeated here, since this repository may be public and they are not fixed yet.

Pinning changes come from pinact and are mechanical. Any other change was generated by Claude — read it before merging.

@github-actions github-actions Bot added CI size/S PR with diff < 50 LOC labels Oct 5, 2026
@paulinebm
paulinebm merged commit a8b2c8e into update-tests-fetcher-script Oct 5, 2026
5 checks passed
@paulinebm
paulinebm deleted the security/workflow-hardening/pr-14607 branch October 5, 2026 08:37
DN6 added a commit that referenced this pull request Nov 19, 2026
* [CI] Rewrite `tests_fetcher.py` as an AST-based import-graph selector with feature-split matrix output

* [tests] Import pipeline/model classes inside the tests that use them so the fetcher does not over-select through shared mixins

* [CI] Give `single_file` model tests their own fetcher job; they need an HF token, not an accelerator

* [tests] Keep `create_flux_ip_adapter_state_dict` in `test_models_transformer_flux.py` instead of a separate `utils.py`

* update

* [CI] Detect the `main` branch by name in `tests_fetcher.py`; a branch checkout has no local `main` ref

* [CI] Mark the workspace as a git safe directory before running `tests_fetcher.py` in the container

* [CI] Select core tests with a `core` marker derived from the `is_*` decorators

`tests/conftest.py` derives `NON_CORE_MARKERS` from the markers the `is_*` decorators in
`testing_utils.py` apply and marks every test carrying none of them as `core` at collection time.
The fetcher imports that set instead of keeping its own list and emits `-m core` for the core jobs in
place of the `not (...)` complement expression. Also drop `-v` from the pytest run, which no other
workflow passes.

* [CI] Credit mixin markers only for bases imported from `testing_utils`; legacy mixins share their names

The legacy cache and IP-Adapter mixins in `test_pipelines_common.py` are unmarked but have the same
class names as the marked ones, so matching by bare name scheduled a `pipelines-cache` job whose
`-m cache` run collected nothing and failed with exit code 5.

* fix(ci): harden GitHub Actions workflows (#14607) (#14945)

fix(ci): harden workflow files flagged on #14607

Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>

* [CI] Count test files in the fetcher summary and add a row for modified test files outside the listed reach

* [CI] Compare each modified file's test reach to the base commit in the fetcher summary

* [CI] Show each modified file's reach on branch and on main in the fetcher summary

* [tests] Use the concrete pipeline classes instead of `AutoPipeline*` in PAG, Kandinsky3, and flashpack tests

* [tests] Ban `AutoPipeline*` imports in tests and switch the SD and SDXL tests to the concrete classes

* [CI] Summarize the selection per changed file with a collapsible import tree, and drop the base-commit comparison

* [CI] Flag test files that import a module which imports much of the library in the fetcher summary

* [CI] Give the tail of a wide diff its own nested dropdowns in the fetcher summary

* [CI] Call out changed files that run no tests and move the import trees into one Details section

* [tests] Import the Flux and SD3 transformers at module level in `test_modeling_common.py`; the file is a leaf

* [tests] Document `marker_decorators` with an example, name the file it reads, and explain the `core` collection hook

* [CI] Obtain the Hub token for single-file tests through OIDC in the fetcher workflow

* [CI] Simplify `tests_fetcher.py` and use dashed CLI flags

* [CI] Write the matrix before the summary so a report failure cannot schedule the full suite

---------

Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant