Skip to content

Fix .ufazienignore matching and switch publish workflows to trusted publishing - #6

Merged
martian56 merged 6 commits into
mainfrom
fix-ufazienignore-matching
May 27, 2026
Merged

Fix .ufazienignore matching and switch publish workflows to trusted publishing#6
martian56 merged 6 commits into
mainfrom
fix-ufazienignore-matching

Conversation

@martian56

Copy link
Copy Markdown
Owner

Summary

  • Fix .ufazienignore matching in both the npm and Python packages. Directory patterns like docs/ / .claude/ never matched on Windows because the matcher compared absolute paths with OS separators against forward-slash patterns, and *.ext wildcards silently failed because the substring check could never hit. Both packages now compute a forward-slash path relative to the project root and match by path segment, basename extension, or exact basename / relative path.
  • Bump both packages to 0.3.1 (patch — bug fix only, no API change to deploy users).
  • Switch publish workflows to OIDC trusted publishing: npm publishes with --provenance and no NPM_TOKEN; PyPI uses pypa/gh-action-pypi-publish with no PYPI_API_TOKEN.

Required follow-up (out of code)

Before the next release, configure trusted publishers:

  • npm: on npmjs.com → ufazien-cli package settings → Trusted Publishers → add this repo, workflow publish_npm_pkg.yml.
  • PyPI: on pypi.org → ufazien-cli project → Publishing → add this repo, workflow publish_python_pkg.yml, environment pypi. Also create a pypi environment in GitHub repo settings.

Once configured, the existing NPM_TOKEN and PYPI_API_TOKEN secrets can be removed.

Test plan

  • Functional test of should_exclude_file (Python) — docs/, .claude/, *.log all excluded; src/ and README.md kept; zip contents verified.
  • Functional test of shouldExcludeFile (JS) — same patterns, same expected outcome; zip contents verified.
  • tsc --noEmit passes on the npm package.
  • First release after merge: verify npm publish succeeds via OIDC (after configuring trusted publisher).
  • First release after merge: verify PyPI publish succeeds via OIDC (after configuring trusted publisher).

martian56 added 6 commits May 27, 2026 14:45
Patterns like 'docs/' or '.claude/' were not excluded on Windows because
the matcher compared raw absolute paths (using OS separators) against
forward-slash patterns. Wildcard patterns like '*.log' silently failed
too because the substring check would never hit.

shouldExcludeFile now computes a forward-slash path relative to the
project root and matches by path segment (for 'dir/'), basename
extension (for '*.ext'), or exact basename / relative path.
Same issue as the npm package: 'docs/'-style directory patterns and
'*.ext' wildcards never matched because the matcher compared the raw
absolute filesystem path against the pattern string.

should_exclude_file now computes a POSIX-normalized path relative to
the project root and matches by path segment, basename extension, or
exact basename / relative path.
Drop NPM_TOKEN auth in favor of OIDC trusted publishing. The workflow
already has id-token: write; we now upgrade npm to the latest version
(trusted publishing support landed in npm 11.5.1) and publish with
--provenance so the registry records the build attestation.

Requires a Trusted Publisher to be configured for the 'ufazien-cli'
npm package pointing at this repo and workflow.
Drop PYPI_API_TOKEN/twine in favor of OIDC trusted publishing via
pypa/gh-action-pypi-publish. The job now runs in a 'pypi' environment
and exchanges its id-token for a short-lived PyPI token at publish
time.

Requires a Trusted Publisher to be configured for 'ufazien-cli' on
PyPI pointing at this repo, the publish_python_pkg.yml workflow, and
the 'pypi' environment.
@martian56 martian56 self-assigned this May 27, 2026
@martian56 martian56 added bug Something isn't working enhancement New feature or request labels May 27, 2026
@martian56
martian56 merged commit 4143254 into main May 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant