Skip to content

Harden PSScriptAnalyzer workflow permissions and action pins - #4

Merged
SamErde merged 1 commit into
mainfrom
samerde-harden-psprettier-workflows
Oct 1, 2026
Merged

SamErde merged 1 commit into
mainfrom
samerde-harden-psprettier-workflows

Conversation

@SamErde

@SamErde SamErde commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Pull Request

Type of Change

  • 📖 Documentation
  • 🪲 Fix
  • 🩹 Patch
  • ⚠️ Security Fix
  • 🚀 Feature
  • 💥 Breaking Change

Issue

Closes #3.

Description

Pin checkout v4.4.0 and CodeQL SARIF upload v3.38.2 to verified full commit SHAs, disable checkout credential persistence, remove the private-repository-only actions: read scope, and cap the analyzer job at 20 minutes. Keep the analyzer inputs, SARIF upload, job-specific security-events: write, and per-ref concurrency unchanged. PR and manual-dispatch triggers remain unchanged, including fork PR analysis.

Validation: actionlint -color=false .github\workflows\PowerShell.yml — passed; parsed YAML assertions for timeout, checkout credentials, permissions, and SARIF inputs — passed; git diff --check — passed. No repository test suite is configured; the PR's Actions run will validate the analyzer and upload in CI.

Checklist

  • 🕵️ I have reviewed my code for errors and tested it.
  • 🚩 My pull request does not contain multiple types of changes.
  • 📄 By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license.

Summary by CodeRabbit

  • Chores
    • Updated automated code checks with a defined time limit and more restricted access and credential handling. No end-user-facing changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 19:42
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d815bc4e-d506-4b1d-9e41-6a5344e74222

📥 Commits

Reviewing files that changed from the base of the PR and between cb5f86c and eb38793.

📒 Files selected for processing (1)
  • .github/workflows/PowerShell.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PowerShell workflow adds a 20-minute job timeout, removes the actions: read permission, disables persisted checkout credentials, and pins checkout and SARIF upload actions to commits.

Changes

Workflow controls

Layer / File(s) Summary
Job and action controls
.github/workflows/PowerShell.yml
The job adds a 20-minute timeout and removes the actions: read permission. Checkout disables credential persistence. Checkout and SARIF upload actions are pinned to commits.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to eb387

The workflow preserves its analyzer and SARIF upload behavior while reducing credential exposure. No material merge-blocking issue remains.

Architecture Summary

Architecture risk: 🔵 Low · up to eb387

The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency.

Changed systems: None identified.

Architecture concerns
No architecture-level concerns identified.

Review details

Before / after behavior

  • observed — Modified behavior in .github/workflows/PowerShell.yml: The job no longer requests actions: read. It adds a 20-minute timeout and replaces the floating checkout v4 reference with a pinned commit, configuring checkout not to persist credentials.
  • observed — Modified behavior in .github/workflows/PowerShell.yml: The SARIF upload action reference is pinned to a commit instead of using the floating v3 tag.
🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The workflow implements the coding objectives in issue #3. It uses full SHA refs with version comments for checkout and SARIF upload, sets persist-credentials: false, removes the actions: read sco… Provide evidence of a successful relevant GitHub Actions run and the evaluation or disposition of any material automated-review findings.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main changes: stricter workflow permissions and immutable action pins.
Out of Scope Changes check ✅ Passed The reported change is limited to .github/workflows/PowerShell.yml. The changes implement the credential, permission, action pin, and timeout controls requested by issue #3. No unrelated product or …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The workflow implements the coding objectives in issue #3. It uses full SHA refs with version comments for checkout and SARIF upload, sets persist-credentials: false, removes the actions: read scope, sets timeout-minutes: 20, and preserves job-level security-events: write, concurrency, triggers, and analyzer inputs. The reported local YAML and diff checks passed. The supplied evidence does not show a completed relevant GitHub Actions run or the result of automated-review finding evaluation.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SamErde

SamErde commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please independently review this workflow hardening change, particularly pinned action compatibility, least-privilege permissions, fork PR SARIF upload, and manual-vs-PR concurrency. Review lane: independent Codex review of the complete one-file CI diff; local implementation validation used actionlint and structural YAML assertions, not an independent reviewer. Requested by GitHub Copilot (Auto; underlying model not exposed).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T19:46:16.212170Z eb38793 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused workflow changes match the stated scope, and no unresolved issues were identified.

Review effort: Balanced
Findings: None

What changed in this PR

This PR hardens the PSScriptAnalyzer workflow without changing its analysis or SARIF upload behavior.

Changes:

  • Pins checkout and SARIF upload actions to full commit SHAs and disables checkout credential persistence.
  • Removes an unnecessary permission and adds a 20-minute job timeout.
File Description
.github/​workflows/​PowerShell.yml Tightens action references, credentials, permissions, and execution time.

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

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: eb38793175

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SamErde
SamErde merged commit 2954924 into main Oct 1, 2026
9 checks passed
@SamErde
SamErde deleted the samerde-harden-psprettier-workflows branch October 1, 2026 00:49
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.

Harden GitHub Actions workflow credentials, permissions, and execution controls

2 participants