Skip to content

fix(actions): correct casing for owner identifier of approved rust-cache action - #1300

Merged
potiuk merged 1 commit into
apache:mainfrom
hainenber:fix/correct-casing-for-approved-swatinem-rust-cache-action
Sep 18, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
hainenber:fix/correct-casing-for-approved-swatinem-rust-cache-action

Conversation

@hainenber

Copy link
Copy Markdown
Contributor

Closes #950

Not sure if there should be any follow-up acts to prevent similar cases, such as having a sample repo that utilizes all approved GHAs for E2E? :D

…ache` action

Signed-off-by: hainenber <dotronghai96@gmail.com>

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed the mechanism rather than just the description: check_asf_allowlist.py:156 matches with fnmatch.fnmatch, which applies os.path.normcase - identity on POSIX. On the Linux runners fnmatch("Swatinem/rust-cache@v2", "swatinem/rust-cache@*") is False, so the lowercase entry really did reject correctly-cased usage. The owner is Swatinem, and #950 is a real consumer hitting it (apache/sedona-spatialbench).

Touching only actions.yml is the complete fix, despite #950 naming approved_patterns.yml: that file carries # This file was generated from actions.yml by gateway/gateway.py. It will be regenerated and committed as part of various workflows. so actions.yml is the single source and the sync regenerates the rest.

On the follow-up you raise: worth doing, and the general form is to make the matching case-insensitive rather than to police the casing of every entry, since GitHub owner and repo identifiers resolve case-insensitively. Opened as #1304. Out of scope for this PR.

LGTM.

@potiuk
potiuk merged commit a67a59b into apache:main Sep 18, 2026
10 checks passed
@hainenber
hainenber deleted the fix/correct-casing-for-approved-swatinem-rust-cache-action branch September 18, 2026 11:25
raboof pushed a commit that referenced this pull request Sep 18, 2026
…1305)

GitHub resolves owner and repository identifiers case-insensitively, so
`uses: Swatinem/rust-cache@v2` and `uses: swatinem/rust-cache@v2` name the
same action. fnmatch applies os.path.normcase, which is the identity on
POSIX, so on the Linux runners an entry whose casing differed from what a
consumer wrote rejected a legitimately approved action -- and said only that
it was not on the allowlist, which is not what was actually wrong.
apache/sedona-spatialbench hit exactly that (#950, entry fixed in #1300).

Folds only the owner/repo half. Tags and SHAs are case-sensitive on GitHub,
so folding the part after "@" would let an exactly-pinned entry match a ref
it never approved; two precision tests pin that, along with one asserting
the fold cannot make a different repo match.

The trusted-owner check needed the same treatment: `Actions/checkout@v4`
was not recognised as belonging to the `actions` owner.

Generated-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should approved_patterns.yml use the correct word casing for actions ?

2 participants