Skip to content

Harden CI: Artifactory OIDC, NuGet lockfiles, tightened permissions - #146

Open
MichaelGHSeg wants to merge 4 commits into
mainfrom
ci/harden-build-publish
Open

Harden CI: Artifactory OIDC, NuGet lockfiles, tightened permissions#146
MichaelGHSeg wants to merge 4 commits into
mainfrom
ci/harden-build-publish

Conversation

@MichaelGHSeg

Copy link
Copy Markdown
Contributor

Summary

  • Add Artifactory OIDC composite action — exchanges GitHub OIDC token for short-lived Artifactory access token, configures NuGet to resolve through `virtual-nuget-thirdparty`
  • Add `ci.yml` — replaces `build.yml`, fork-aware runner selection, `dotnet restore --locked-mode`, SHA-pinned actions
  • Add `deploy.yml` — replaces `release.yml`, tag-triggered, tightened permissions (`write-all` → `contents: read + id-token: write`), `environment: nuget` gate
  • Add `Directory.Build.props` — enables NuGet lockfiles repo-wide
  • Add `packages.lock.json` for `Analytics-CSharp` and `Tests` projects
  • Update `e2e-tests.yml` — remove `E2E_TESTS_TOKEN` (sdk-e2e-tests going public), fork-aware

Notes

  • NuGet has no OIDC trusted publishing — `NUGET_API_KEY` secret remains required
  • Old `build.yml` + `release.yml` can be deleted once new workflows are validated

Test plan

  • CI runs on this PR
  • Artifactory OIDC exchange succeeds on same-repo CI
  • Before merging: set `ARTIFACTORY_URL` repository variable
  • Before merging: create `nuget` GitHub environment with protection rules

- Add Artifactory OIDC composite action (configures NuGet to use virtual-nuget-thirdparty)
- Add ci.yml: fork-aware, dotnet build/test, --locked-mode, SHA-pinned actions
- Add deploy.yml: tag-triggered, environment: nuget gate, tightened permissions
- Add Directory.Build.props to enable NuGet lockfiles repo-wide
- Add packages.lock.json for Analytics-CSharp and Tests projects
- Update e2e-tests.yml: remove E2E_TESTS_TOKEN, fork-aware
Comment thread .github/workflows/deploy.yml
didiergarcia
didiergarcia previously approved these changes Jul 10, 2026
Rewrite composite action to use single-script pattern matching
analytics-python: audience=${ARTIFACTORY_URL}, provider_name=
github-actions-segmentio, and add JWT claim logging for debugging.
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.

2 participants