Skip to content

Fix .NET caching prerequisites and test artifact workflow - #46336

Draft
4booser wants to merge 1 commit into
github:mainfrom
4booser:codex/fix-dotnet-workflow-examples
Draft

4booser wants to merge 1 commit into
github:mainfrom
4booser:codex/fix-dotnet-workflow-examples

Conversation

@4booser

@4booser 4booser commented Oct 15, 2026

Copy link
Copy Markdown

Prepared with OpenAI Codex.

Why:

Two examples in "Building and testing .NET" can prevent readers from running the documented workflows:

  • The test artifact example nests steps under strategy, which is not a valid GitHub Actions job structure.
  • The caching example enables cache: true without explaining that a committed NuGet lock file must already be available. setup-dotnet fails when it cannot find a matching lock file.

What's being changed (if available, include any code snippets, screenshots, or gifs):

  • Move the artifact example's five existing steps to the job level, preserving their commands and the always() upload condition.
  • Explain how to generate and commit packages.lock.json before enabling caching.
  • Show cache-dependency-path: '**/packages.lock.json' for lock files in subdirectories or multiple projects.
  • Restore existing dependencies with dotnet restore --locked-mode instead of adding a dependency during the cached workflow.

References:

Validation:

Local checks passed against upstream commit 0226a2d78cf2be40ee3d769ec5661638461af0cc; the original article is unchanged at this branch's base:

  • Content linter: node --import tsx src/content-linter/scripts/lint-content.ts --paths content/actions/tutorials/build-and-test-code/net.md.
  • npm run build.
  • CHANGED_FILES=content/actions/tutorials/build-and-test-code/net.md npm run test -- src/content-render/tests/render-changed-and-deleted-files.ts --run (2 tests).
  • Parsed the original and corrected YAML and compared job/strategy placement with the official Actions workflow schema. Confirmed all five artifact steps and their contents are preserved.
  • git diff --check.

The workflows have not been executed on a GitHub-hosted runner. The render test exited successfully with a server-shutdown warning.

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

@welcome

welcome Bot commented Oct 15, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions Bot added the triage Do not begin working on this issue until triaged by the team label Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
actions/tutorials/build-and-test-code/net.md fpt
ghec
ghes@ 3.22 3.21 3.20 3.19 3.18
fpt
ghec
ghes@ 3.22 3.21 3.20 3.19 3.18

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant