Skip to content

Commit 258ce1f

Browse files
CopilotSaadnajmi
andauthored
fix: "Lint PR Title" job cache validation error (#2722)
## Problem The "Lint PR Title" job in the PR workflow was consistently failing on first run with the following error: > Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved. After a rerun, the job would usually succeed, but this was annoying and required manual intervention. ## Root Cause The `lint-title` job uses the `microsoft-setup-toolchain` action, which has `cache-npm-dependencies: yarn` enabled by default. This causes the underlying `actions/setup-node` action to attempt to cache yarn directories. However, the `lint-title` job never runs `yarn install` - it only executes `npx @rnx-kit/[email protected]` to validate the PR title. Since the cache paths don't exist when the job runs for the first time (before dependencies are installed), the cache action fails with a validation error. ## Solution Disabled caching for the `lint-title` job by setting `cache-npm-dependencies: ''` in the setup-toolchain step. This is appropriate because: 1. The job doesn't install any dependencies - it only uses `npx` to run a single package 2. Caching provides no benefit for this job 3. This eliminates the cache path validation error ## Testing - Verified the YAML syntax is valid - The change is minimal and only affects the `lint-title` job - Other jobs that need caching remain unchanged Fixes #2403 <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>"Lint PR Title" PR Job always fails</issue_title> > <issue_description>The job always fails with the following error: > > > Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved. > > After a rerun it usually succeeds. But it's quite annoying, and would be nice to fix. </issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> Fixes #2721 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Saadnajmi <[email protected]>
1 parent 2b2f679 commit 258ce1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

.github/workflows/microsoft-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
uses: ./.github/actions/microsoft-setup-toolchain
2525
with:
2626
node-version: '22'
27+
cache-npm-dependencies: ''
2728
# We lint the PR title instead of the commit message to avoid script injection attacks.
2829
# Using environment variables prevents potential security vulnerabilities as described in:
2930
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#example-of-a-script-injection-attack

0 commit comments

Comments
 (0)