Skip to content

fix: resolve config file path against GITHUB_WORKSPACE#29

Merged
matmar10 merged 1 commit intomasterfrom
fix/config-file-path
Apr 21, 2026
Merged

fix: resolve config file path against GITHUB_WORKSPACE#29
matmar10 merged 1 commit intomasterfrom
fix/config-file-path

Conversation

@matmar10
Copy link
Copy Markdown
Owner

Summary

  • Fixes the config_path input resolving to the action's own dist/ directory instead of the consuming repo's workspace
  • Replaces path.join(__dirname, '/../', configPath) with path.join(process.env.GITHUB_WORKSPACE || process.cwd(), configPath)

Closes #26

Root cause

__dirname inside dist/index.js points to the action's install path (e.g. …/_actions/matmar10/prcolinter/v1/dist). Going one level up still lands inside the action bundle, not the checked-out consumer repo. GITHUB_WORKSPACE is the correct root.

Test plan

  • Open a PR in a repo that has .github/prcolinterrc.json with at least one rule override and verify the rule takes effect
  • Verify the debug log shows the correct resolved path under GITHUB_WORKSPACE
  • Verify behaviour is unchanged when no config file is present (file not found → empty {} → only default rules apply)

🤖 Generated with Claude Code

Previously used __dirname which pointed to the action's own dist/
directory, so the config file was never found in the consuming repo.

Closes #28

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

✅🙏🏻 Conventional Commit 🥳 🎉

🤖 Beep boop! Congrats, it like all your commit messages conform to the Conventional Commit spec! 👏👏👏

Your PR can be closed. Coffee is for closers, so here's a coffee for you: ☕️

Commit Message Lint Report

  • ✏️ 1 commit(s)
  • 👤 1 author(s)
  • 0 lint error(s)
  • ⚠️ 0 lint warning(s)

@matmar10 matmar10 merged commit 5ed3b17 into master Apr 21, 2026
1 check passed
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.

Local rules specified in prcolinterrc.json ignored when actions run

1 participant