Repository navigation
Conversation
Pin GitHub actions to commit SHAs, pin the Dockerfile base images by digest, add NuGet lock files with a locked restore, and let Dependabot keep the image digests current.
The Docker engine on the GitHub runners doesn't support COPY --parents, and the lock files can't be flattened like the csproj files because they share a name.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
=======================================
Coverage 99.81% 99.81%
=======================================
Files 72 72
Lines 555 555
Branches 32 32
=======================================
Hits 554 554
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the Pinned-Dependencies findings from OpenSSF Scorecard, which currently scores 3/10.
actions/checkout,setup-dotnet,upload-artifact,download-artifactandgithub/codeql-actionin the build pipeline are now pinned to commit SHAs with the version in a trailing comment, matching the third-party actions.scorecard.ymlis left alone here because it is being changed in the open Scorecard publish PR, which gets the same pins.BASE_IMAGE_*ARGs are replaced with literalFROMlines pinned by digest (dotnet/sdk:10.0-alpineand the runtime image). Dependabot can't update images that come from ARGs, so the literal form keeps them maintained. Adockerecosystem is added to the monthly Dependabot group so the tag and digest are bumped together.Directory.Build.propsturns onRestorePackagesWithLockFile, so each project now has a committedpackages.lock.json, and restores fail in CI (CI=true) when a lock file is out of date. The Dockerfile now copies the source before restoring and runsdotnet restore --locked-mode. The lock files all share one name, so the old trick of copying the csproj files flat and moving them into folders doesn't work for them, and the runners' Docker doesn't supportCOPY --parents. Dependabot updates the lock files along withDirectory.Packages.props.Generated solutions get the lock files and the locked CI restore too. When a package is added locally, the next restore updates the lock file and it is committed with the change.
Related issues
None
Type of change
Shared layers
Checklist
dotnet buildanddotnet testpass locally with no warnings.