Skip to content

Pin GitHub Actions to full-length commit SHAs - #273

Merged
Rick Brighenti (rbrighenti) merged 1 commit into
mainfrom
users/rbrighenti/pin-dotnet-github-actions
Oct 23, 2026
Merged

Rick Brighenti (rbrighenti) merged 1 commit into
mainfrom
users/rbrighenti/pin-dotnet-github-actions

Conversation

@rbrighenti

Copy link
Copy Markdown
Contributor

Summary

Pins every GitHub Actions uses: reference in this repo to a full-length (40-character) commit SHA with a trailing version comment, and adds a Dependabot github-actions config to keep the pins up to date. This is Microsoft's upcoming GitHub requirement: https://aka.ms/action-pinning.

Replaces #264, which was opened from a fork and closed without merging. This branch is in microsoft/Agent365-dotnet, so CI gets the repo secrets and variables it needs (AZURE_OPENAI_*).

Pinned actions

Action Before After Used in
actions/checkout @v4 @11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 ci.yml, dependency-review.yml
actions/setup-dotnet @v4 @67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 ci.yml
actions/upload-artifact @v4 @ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 ci.yml
actions/dependency-review-action @v4 @2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0 dependency-review.yml

Each action stays on its current major version and is pinned to the commit of the latest release in that major. I resolved each SHA from the action's own repo. All four release tags are lightweight tags that point directly at commits. Each SHA is also the commit that @v4 resolves to today, so action behavior doesn't change.

Dependabot

New .github/dependabot.yml with weekly github-actions updates, grouped into a single PR. It sets cooldown.default-days: 7, so a new release isn't proposed until it has been public for a week. This config matches the other A365 repos: microsoft/Agent365-python#277, microsoft/Agent365-nodejs#309, microsoft/Agent365-devTools#506, microsoft/Agent365-Samples#342 and microsoft/agent365-skills#79.

How to verify

gh api repos/actions/checkout/commits/v4.4.0 --jq .sha returns the pinned SHA. The same check works for the other tags.

Pin every GitHub Actions `uses:` reference to a full-length commit SHA
with a trailing version comment (https://aka.ms/action-pinning). Each
action stays on its current major version, pinned to the commit of the
latest release in that major:

- actions/checkout v4.4.0
- actions/setup-dotnet v4.3.1
- actions/upload-artifact v4.6.2
- actions/dependency-review-action v4.9.0

Add a Dependabot github-actions config with a 7-day cooldown to keep
the pins up to date.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 12:59
@rbrighenti
Rick Brighenti (rbrighenti) requested a review from a team as a code owner October 21, 2026 12:59
@github-actions

Copy link
Copy Markdown

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

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 11d5960a326750d5838078e36cf38b85af677262 🟢 5.9
Details
CheckScoreReason
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Packaging⚠️ -1packaging workflow not detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
SAST🟢 10SAST tool is run on all commits
actions/actions/dependency-review-action 2031cfc080254a8a887f58cffee85186f0e49e48 🟢 7.7
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Security-Policy🟢 9security policy file detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
SAST🟢 9SAST tool detected but not run on all commits

Scanned Files

  • .github/workflows/dependency-review.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.

🟢 Approval recommended

The pins match upstream releases, and no blocking issues remain in the workflow or Dependabot changes.

No open issues 🎉

What changed in this PR

Hardens the SDK’s CI workflows by replacing mutable action tags with commit pins and automating pin updates.

Changes:

  • Pins all five action references to full-length SHAs with version comments.
  • Adds grouped weekly Dependabot updates with a seven-day cooldown.
File Description
.github/​workflows/​dependency-review.yml Pins checkout and dependency-review actions.
.github/​workflows/​ci.yml Pins checkout, .NET setup, and artifact upload actions.
.github/​dependabot.yml Configures grouped weekly action updates and cooldown.

Review effort: Balanced

@rbrighenti
Rick Brighenti (rbrighenti) merged commit 09b904a into main Oct 23, 2026
8 checks passed
@rbrighenti
Rick Brighenti (rbrighenti) deleted the users/rbrighenti/pin-dotnet-github-actions branch October 23, 2026 16:50
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.

4 participants