[release/v7.6.1] [StepSecurity] ci: Harden GitHub Actions tags by daxian-dbw · Pull Request #27236 · PowerShell/PowerShell · GitHub
Skip to content

[release/v7.6.1] [StepSecurity] ci: Harden GitHub Actions tags#27236

Merged
daxian-dbw merged 3 commits intoPowerShell:release/v7.6.1from
daxian-dbw:backport/release/v7.6.1/27201-34375e905
Apr 9, 2026
Merged

[release/v7.6.1] [StepSecurity] ci: Harden GitHub Actions tags#27236
daxian-dbw merged 3 commits intoPowerShell:release/v7.6.1from
daxian-dbw:backport/release/v7.6.1/27201-34375e905

Conversation

@daxian-dbw
Copy link
Copy Markdown
Member

Backport of #27201 to release/v7.6.1

Triggered by @daxian-dbw on behalf of @step-security-bot

Original CL Label: CL-BuildPackaging

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Backports GitHub Actions tag hardening to pin mutable workflow action references to immutable SHAs in the release/v7.6.1 CI workflows.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Verified by cherry-picking onto release/v7.6.1, resolving workflow conflicts by preserving the release-branch workflow structure and pinning the existing action versions to immutable SHAs, then confirming the staged diffs were limited to the intended action hardening updates. No local workflow run was performed; CI on the backport PR will validate the workflows.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Medium risk because the change affects multiple CI workflows and reusable workflow references, which can break automation if pinned incorrectly. The resolution preserved the release branch workflow structure and applied only the intended tag hardening changes.

Merge Conflicts

Conflicts occurred in .github/workflows/labels.yml, .github/workflows/linux-ci.yml, .github/workflows/macos-ci.yml, .github/workflows/verify-markdown-links.yml, .github/workflows/windows-ci.yml, .github/workflows/windows-packaging-reusable.yml, and .github/workflows/xunit-tests.yml. The release branch used older major versions of several actions than main. Resolved by keeping the release-branch workflow structure and pinning those existing action versions to immutable SHAs instead of upgrading action major versions as part of this backport.

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
@daxian-dbw daxian-dbw added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Apr 9, 2026
@daxian-dbw daxian-dbw requested a review from jshigetomi as a code owner April 9, 2026 17:42
Copilot AI review requested due to automatic review settings April 9, 2026 17:42
@daxian-dbw daxian-dbw requested a review from a team as a code owner April 9, 2026 17:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Backport to release/v7.6.1 that hardens GitHub Actions usage by replacing mutable action tags with immutable commit SHAs across CI workflows and composite actions.

Changes:

  • Pinned actions/checkout and actions/setup-dotnet (and several actions/github-script / artifact actions) to specific commit SHAs in release-branch workflows.
  • Updated internal composite actions under .github/actions/** to use pinned action SHAs where modified.
  • Kept release-branch workflow structure while applying tag-hardening updates.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.github/workflows/xunit-tests.yml Pins checkout/setup-dotnet to SHAs for the reusable xUnit workflow.
.github/workflows/windows-packaging-reusable.yml Pins checkout/setup-dotnet to SHAs for reusable Windows packaging workflow.
.github/workflows/windows-ci.yml Pins checkout to SHA across Windows CI jobs.
.github/workflows/verify-markdown-links.yml Pins checkout to SHA for markdown link verification workflow.
.github/workflows/macos-ci.yml Pins checkout/setup-dotnet/upload-artifact to SHAs in macOS CI.
.github/workflows/linux-ci.yml Pins checkout to SHA across Linux CI jobs.
.github/workflows/labels.yml Pins checkout and github-script to SHAs for label enforcement.
.github/workflows/copilot-setup-steps.yml Pins checkout to SHA for Copilot setup workflow.
.github/workflows/analyze-reusable.yml Pins setup-dotnet to SHA in reusable CodeQL workflow.
.github/actions/test/windows/action.yml Pins download-artifact and setup-dotnet to SHAs in Windows test composite action.
.github/actions/test/process-pester-results/action.yml Pins upload-artifact to SHA in Pester results processing action.
.github/actions/test/nix/action.yml Pins download-artifact/setup-dotnet/github-script to SHAs in nix test composite action.
.github/actions/test/linux-packaging/action.yml Pins setup-dotnet/upload-artifact to SHAs in Linux packaging composite action.
.github/actions/infrastructure/path-filters/action.yml Pins github-script to SHA in path filter composite action.
.github/actions/infrastructure/get-changed-files/action.yml Pins github-script to SHA in get-changed-files composite action.
.github/actions/build/ci/action.yml Pins setup-dotnet/upload-artifact to SHAs in CI build composite action.

- analyze
- windows_packaging
if: always()
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

ready_to_merge still references the reusable workflow via a mutable tag (PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0). To fully harden workflow dependencies, pin this to an immutable commit SHA (and optionally keep the version comment) like the other uses: updates in this PR.

Suggested change
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@<40-character-commit-sha> # v1.0.0

Copilot uses AI. Check for mistakes.
- infrastructure_tests
# - analyze
if: always()
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

ready_to_merge is still consuming PowerShell/compliance/.github/workflows/ready-to-merge.yml via the mutable @v1.0.0 tag. If this PR is intended to harden all workflow dependencies, this should be pinned to a specific commit SHA as well.

Suggested change
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@<FULL_40_CHARACTER_COMMIT_SHA_FOR_V1_0_0>

Copilot uses AI. Check for mistakes.
- macos_test_unelevated_ci
- macos_test_unelevated_others
if: always()
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The ready_to_merge job still uses PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0, which is a mutable tag. Consider pinning the reusable workflow reference to a commit SHA to match the tag-hardening goal of this change set.

Suggested change
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@<FULL_40_CHARACTER_COMMIT_SHA_FOR_V1_0_0>

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/xunit-tests.yml Outdated
Comment on lines +52 to +56
@@ -53,4 +53,4 @@ jobs:
if: always()
with:
name: ${{ inputs.test_results_artifact_name }}
path: ${{ github.workspace }}/xUnitTestResults.xml
path: ${{ github.workspace }}/xUnitTestResults.xml No newline at end of file
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The Upload xUnit results step still uses actions/upload-artifact@v7 (mutable tag). To complete the action hardening in this workflow, pin actions/upload-artifact to an immutable commit SHA (as done for checkout/setup-dotnet).

Copilot uses AI. Check for mistakes.
Comment on lines 85 to 89
- name: Upload Build Artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: windows-packaging-${{ matrix.architecture }}-${{ matrix.channel }}
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The Upload Build Artifacts step still references actions/upload-artifact@v7 (mutable tag). For consistent action hardening, pin actions/upload-artifact to a full commit SHA.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to 17
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

While actions/setup-dotnet is now pinned, this composite action still references actions/download-artifact@v4 later in the file via a mutable tag. To fully harden action dependencies, pin actions/download-artifact to an immutable commit SHA as well.

Copilot uses AI. Check for mistakes.
@daxian-dbw daxian-dbw merged commit 10dccb0 into PowerShell:release/v7.6.1 Apr 9, 2026
38 checks passed
@daxian-dbw daxian-dbw deleted the backport/release/v7.6.1/27201-34375e905 branch April 9, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants