Skip to content

ci: adopt NuGet trusted publishing - #530

Merged
JerrettDavis merged 1 commit into
mainfrom
copilot/trusted-publishing-oidc
Sep 3, 2026
Merged

JerrettDavis merged 1 commit into
mainfrom
copilot/trusted-publishing-oidc

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Summary

  • bind the NuGet publishing workflow to the production GitHub environment
  • request id-token: write where the NuGet publish job runs
  • swap repository NuGet API key usage for NuGet/login@v1 OIDC-based temporary credentials

Real Behavior Proof

  • Parsed the updated workflow YAML successfully after the transform.
  • Verified each updated workflow now contains environment: production, uses: NuGet/login@v1, and id-token: write.
  • What was not tested: a live nuget.org publish, because the automated browser session was not authenticated to nuget.org for trusted publishing policy creation.

Bind the NuGet publishing job to the GitHub production environment, request OIDC id-token permissions, and exchange credentials through NuGet/login instead of repository API key secrets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 3, 2026 17:50
@JerrettDavis
JerrettDavis enabled auto-merge (squash) September 3, 2026 17:50
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
See the Details below.

License Issues

.github/workflows/ci.yml

PackageVersionLicenseIssue Type
NuGet/login1.*.*NullUnknown License
Denied Licenses: GPL-2.0, GPL-3.0, AGPL-3.0

OpenSSF Scorecard

PackageVersionScoreDetails
actions/NuGet/login 1.*.* UnknownUnknown

Scanned Files

  • .github/workflows/ci.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The current workflow can still create tags/releases while silently skipping NuGet.org publishing if credentials aren’t issued, which can result in incomplete releases.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the CI release workflow to publish NuGet packages via OIDC-based Trusted Publishing instead of using a long-lived NuGet API key, aligning releases with GitHub Environments for stronger controls.

Changes:

  • Bind the release job to the production environment.
  • Add id-token: write permission to enable OIDC token exchange.
  • Replace secrets.NUGET_API_KEY usage with NuGet/login@v1 and its temporary NUGET_API_KEY output.
File summaries
File Description
.github/workflows/ci.yml Updates the release job to use GitHub Environment + OIDC (NuGet/login@v1) for NuGet.org publishing.
Review details

Suppressed comments (1)

.github/workflows/ci.yml:312

  • If NuGet/login@v1 does not issue a token (e.g., trusted publishing not fully configured yet), this job will still succeed and create a tag/GitHub Release while skipping the NuGet.org publish. For the push-to-main release job, it’s safer to fail fast so you don’t ship a release without the NuGet package.
        run: |
          if [ -n "$NUGET_API_KEY" ]; then
            dotnet nuget push ./artifacts/*.nupkg \
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yml
Comment on lines 140 to +147
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 90
environment: production
permissions:
contents: write
packages: write
id-token: write
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 09/03/2026 - 17:58:23
  Coverage date: 09/03/2026 - 17:56:43 - 09/03/2026 - 17:58:12
  Parser: MultiReport (8x Cobertura)
  Assemblies: 5
  Classes: 1817
  Files: 611
  Line coverage: 97.4%
  Covered lines: 48648
  Uncovered lines: 1278
  Coverable lines: 49926
  Total lines: 105800
  Branch coverage: 84.4% (15618 of 18483)
  Covered branches: 15618
  Total branches: 18483
  Method coverage: 97.3% (9510 of 9772)
  Full method coverage: 91.7% (8961 of 9772)
  Covered methods: 9510
  Fully covered methods: 8961
  Total methods: 9772

PatternKit.Core                                                                                                     96.2%
  PatternKit.Application.ActivityTracking.ActivityGateState                                                          100%
  PatternKit.Application.ActivityTracking.ActivityLease                                                              100%
  PatternKit.Application.ActivityTracking.ActivityRecord                                                             100%
  PatternKit.Application.ActivityTracking.ActivityTracker                                                            100%
  PatternKit.Application.Aggregates.AggregateCommandHandler<T1, T2, T3>                                              100%
  PatternKit.Application.Aggregates.AggregateCommandResult<T>                                                        100%
  PatternKit.Application.Aggregates.AggregateRoot<T1, T2>                                                            100%
  PatternKit.Application.AntiCorruption.AntiCorruptionLayer<T1, T2>                                                 90.4%
  PatternKit.Application.AntiCorruption.AntiCorruptionResult<T>                                                      100%
  PatternKit.Application.AuditLog.AuditLogAppendResult<T>                                                           85.7%
  PatternKit.Application.AuditLog.InMemoryAuditLog<T1, T2>                                                          95.4%
  PatternKit.Application.BoundedContexts.BoundedContextAdapter                                                       100%
  PatternKit.Application.BoundedContexts.BoundedContextCapability                                                   83.3%
  PatternKit.Application.BoundedContexts.BoundedContextDescriptor                                                   95.4%
  PatternKit.Application.CompensatingTransactions.CompensatingTransaction<T>                                        96.9%
  PatternKit.Application.CompensatingTransactions.CompensatingTransactionExecution<T>                                100%
  PatternKit.Application.CompensatingTransactions.CompensatingTransactionRecord                                      100%
  PatternKit.Application.CompensatingTransactions.CompensatingTransactionStep<T>                                     100%
  PatternKit.Application.CompensatingTransactions.CompensatingTransactionStepBuilder<T>                              100%
  PatternKit.Application.ContextMaps.ContextMapDescriptor                                                           96.8%
  PatternKit.Application.ContextMaps.ContextMapRelationship                                                          100%
  PatternKit.Application.DataMapping.DataMapper<T1, T2>                                                             94.6%
  PatternKit.Application.DataMapping.DataMapperError                                                                  90%
  PatternKit.Application.DataMapping.DataMapperResult<T>                                                            84.6%
  PatternKit.Application.DomainEvents.DomainEventDispatcher<T>                                                      95.4%
  PatternKit.Application.DomainEvents.DomainEventDispatchResult                                                      100%
  PatternKit.Application.DomainServices.DomainServiceOperation<T1, T2>                                               100%
  PatternKit.Application.DomainServices.DomainServiceRegistry<T1, T2>                                                100%
  PatternKit.Application.EventSourcing.EventStoreAppendResult                                                        100%
  PatternKit.Application.EventSourcing.InMemoryEventStore<T1, T2>                                                   97.9%
  PatternKit.Application.EventSourcing.StoredEvent<T1, T2>                                                            80%
  PatternKit.Application.EventualConsistency.EventualConsistencyEvaluation<T>                                       92.3%
  PatternKit.Application.EventualConsistency.EventualConsistencyMonitor<T>                                          97.2%
  PatternKit.Application.EventualConsistency.EventualConsistencyMonitorState<T>                                      100%
  PatternKit.Application.EventualConsistency.EventualConsistencyWatermarks<T>                                       96.7%
  PatternKit.Application.FeatureToggles.FeatureToggleDecision                                                       87.5%
  PatternKit.Application.FeatureToggles.FeatureToggleRule<T>                                                         100%
  PatternKit.Application.FeatureToggles.FeatureToggleSet<T>                                                         96.9%

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.44%. Comparing base (97603ea) to head (e70cd6c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main     #530     +/-   ##
=========================================
  Coverage   97.44%   97.44%             
=========================================
  Files         611      611             
  Lines       49926    49926             
  Branches     3230       34   -3196     
=========================================
+ Hits        48649    48650      +1     
+ Misses       1277     1276      -1     
Flag Coverage Δ
unittests 97.44% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   12m 1s ⏱️
 4 197 tests  4 197 ✅ 0 💤 0 ❌
13 043 runs  13 043 ✅ 0 💤 0 ❌

Results for commit e70cd6c.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Validation Results

Version: ``

✅ Validation Steps

  • Build solution
  • Run tests
  • Build documentation
  • Dry-run NuGet packaging

📊 Artifacts

Dry-run artifacts have been uploaded and will be available for 7 days.


This comment was automatically generated by the PR validation workflow.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants