Skip to content

CI: Skip NuGet publishing when no source code changes#66

Merged
LittleLittleCloud merged 3 commits intomainfrom
copilot/fix-ci-nuget-publishing
Oct 27, 2025
Merged

CI: Skip NuGet publishing when no source code changes#66
LittleLittleCloud merged 3 commits intomainfrom
copilot/fix-ci-nuget-publishing

Conversation

Copy link
Contributor

Copilot AI commented Oct 27, 2025

Currently, every push to main publishes NuGet packages, even for documentation-only commits.

Changes

Modified .github/workflows/ci.yml:

  • Added source change detection step using git diff against parent commit
  • Made NuGet push conditional on source_changed output
  • Increased checkout fetch-depth: 2 to enable diff comparison

Source detection includes:

  • Code files: .cs, .razor, .csproj, .props, .targets
  • Source directories: src/
  • Build-affecting workflows: ci.yml, release.yml

Behavior:

  • Source changes → packages published to NuGet.org
  • Documentation-only changes → build/test run, NuGet push skipped
  • Artifacts always uploaded for verification

Falls back to git ls-tree when parent commit unavailable (initial commit edge case).

Original prompt

This section details on the original issue you should resolve

<issue_title>CI - Don't publish nuget package if there's no source code change</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits October 27, 2025 04:16
Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com>
Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI to not publish NuGet package without source code change CI: Skip NuGet publishing when no source code changes Oct 27, 2025
@LittleLittleCloud LittleLittleCloud marked this pull request as ready for review October 27, 2025 05:50
@LittleLittleCloud LittleLittleCloud enabled auto-merge (squash) October 27, 2025 05:50
@LittleLittleCloud LittleLittleCloud merged commit f0b7dde into main Oct 27, 2025
8 checks passed
@LittleLittleCloud LittleLittleCloud deleted the copilot/fix-ci-nuget-publishing branch October 27, 2025 05:52
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.

CI - Don't publish nuget package if there's no source code change

2 participants