Skip to content

[Repo Assist] ci: add GitHub Actions workflow to run unit tests on push/PRΒ #123

@github-actions

Description

@github-actions

πŸ€– This is an automated pull request from Repo Assist.

Summary

Adds .github/workflows/ci.yml β€” a minimal CI workflow that runs the repository's existing unit tests on every push to master and every pull request targeting master.

Motivation

The repository currently has no CI for the extension code itself (only the Repo Assist scheduling workflow). This means pull requests and direct commits have no automated signal about whether they break existing tests. Adding a CI workflow provides:

  • Instant feedback for contributors: broken utility functions are caught before merge.
  • Confidence for maintainers: merging Repo Assist PRs (and human PRs) comes with a green check.
  • Documentation: the workflow makes the npm run test:unit test runner discoverable.

Implementation

.github/workflows/ci.yml runs node --test test/unit.test.js (the existing test:unit script) against a matrix of Node.js 18, 20, and 22 β€” the LTS range the pure-utility tests are compatible with.

No npm install step is needed: test/unit.test.js imports only Node built-ins (node:test, node:assert/strict, fs, path, os) and the local lib/utils.js module.

Test Status

βœ… All 7 unit tests pass locally on Node.js 22:

β–Ά findFiles
  βœ” returns path when file exists in exact directory
  βœ” returns null when file does not exist anywhere in tree
  βœ” walks up the directory tree to find file
  βœ” returns file in the deepest matching directory when multiple exist
  βœ” accepts an array of file names and returns first match found
  βœ” stops at parent boundary β€” does not escape above parent
  βœ” handles a single-segment directory (file at root)
βœ” findFiles (7 pass, 0 fail)

No production code changes β€” this PR adds only the workflow file.

Generated by Repo Assist Β· β—·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

Warning

πŸ›‘οΈ Protected Files β€” Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files: .github/workflows/ci.yml.

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission. A human must create the pull request manually.

To create a pull request with the changes:

# Download the patch from the workflow run
gh run download 23878393168 -n agent-artifacts -D /tmp/agent-artifacts-23878393168

# Create a new branch
git checkout -b repo-assist/eng-ci-unit-tests-2026-04-02-73cd649bcdaf50ad master

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-artifacts-23878393168/aw-repo-assist-eng-ci-unit-tests-2026-04-02.patch

# Push the branch and create the pull request
git push origin repo-assist/eng-ci-unit-tests-2026-04-02-73cd649bcdaf50ad
gh pr create --title '[Repo Assist] ci: add GitHub Actions workflow to run unit tests on push/PR' --base master --head repo-assist/eng-ci-unit-tests-2026-04-02-73cd649bcdaf50ad --repo soderlind/vscode-phpcbf

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions