Skip to content

🔒 security(ci): harden and optimize GitHub Actions workflows - #232

Merged
SamErde merged 3 commits into
mainfrom
samerde-review-gh-actions-workflows
Sep 14, 2026
Merged

SamErde merged 3 commits into
mainfrom
samerde-review-gh-actions-workflows

Conversation

@SamErde

@SamErde SamErde commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reviewed all 12 GitHub Actions workflows for security, best practices, and redundant/obsolete steps/jobs, and applied targeted, low-risk fixes.

Security

  • Added missing harden-runner egress auditing to Deploy Zensical.yml (both jobs) and Validate Zensical.yml — these were outliers among all other workflows
  • Replaced the unmaintained, mutable-tag docker://antonyurchenko/git-release:latest@sha256:... action with the maintained, SHA-pinned softprops/action-gh-release@efb35369 (v3.0.3) in Publish Release.yml; it now extracts the matching CHANGELOG.md section for the release body
  • Scoped contents: write permission down from workflow-level to job-level in Publish Release.yml
  • Added a missing version comment to the SHA-pinned codacy/codacy-analysis-cli-action

Reliability

  • Added timeout-minutes to every job that lacked one, across all 12 workflows, to prevent runaway/hung jobs from consuming runner minutes indefinitely
  • Fixed Publish Release.yml's push trigger: it previously combined tags, branches, and paths filters on one push trigger, but paths filtering is unreliable/ignored for tag pushes — simplified to a tags-only trigger with if: startsWith(github.ref, 'refs/tags/v') as the guard

Dead code / redundancy cleanup

  • Build External Help.yml: removed the stale "Build Module" (no-emoji) entry from workflow_run.workflows, keeping only the current "👷 Build Module" name
  • scorecard.yml: removed a dead github.event_name == 'pull_request' condition — the workflow has no pull_request trigger
  • Format Markdown.yml: fixed a stale header comment claiming a push trigger that had already been removed (workflow is workflow_dispatch-only)
  • Validate Module Manifest.yml: trimmed the large commented-out pull_request/push trigger block; left the workflow intentionally manual-only (workflow_dispatch), per confirmation during planning

Decisions made during review

  • Validate Module Manifest.yml: kept as manual-only rather than re-enabling automatic triggers or removing the workflow — just cleaned up the dead comment block.
  • Release action replacement: chose softprops/action-gh-release over re-pinning the old unmaintained action, since it's actively maintained and SHA-pinnable.

Verification

  • All edited workflow YAML validated with Python's yaml.safe_load — parses cleanly
  • Ran actionlint across .github/workflows/ — zero findings

No functional/behavioral changes beyond the release-action swap, which preserves the same outputs (GitHub release creation + artifact attachment + PowerShell Gallery publish).

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

Summary by CodeRabbit

  • Release Process

    • Releases now trigger only from version tags.
    • Release notes are generated from the matching changelog section.
    • Release packages now include relevant ZIP artifacts.
  • Workflow Reliability

    • Automated jobs now have execution time limits to prevent stalled runs.
    • Documentation formatting and manifest validation remain manual-only.
  • Security

    • Runner activity auditing was added to documentation build and deployment workflows.
    • Security analysis continues with clearer action version tracking.
  • Maintenance

    • Documentation help generation now follows the renamed module-build workflow.

- Add missing harden-runner egress auditing to Deploy Zensical and Validate Zensical
- Add timeout-minutes to jobs across all workflows to prevent runaway runs
- Replace unmaintained antonyurchenko/git-release with SHA-pinned softprops/action-gh-release,
  extracting the matching CHANGELOG.md section for release notes
- Fix Publish Release push trigger (paths filter is unreliable on tag pushes) and scope
  contents:write permission to the job level
- Fix stale workflow_run reference to the retired 'Build Module' workflow name
- Remove dead pull_request condition in scorecard.yml (no such trigger exists)
- Clean up stale comments and dead commented-out triggers in Format Markdown and
  Validate Module Manifest (left intentionally manual-only)
- Add missing version comment to SHA-pinned codacy-analysis-cli-action

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 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-14T16:13:29.908961Z ac3582f New commits
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e266f1f2-52ad-4f21-9898-b467c46945f4

📥 Commits

Reviewing files that changed from the base of the PR and between 9b400bd and ac3582f.

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

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: 93461c1f-cc51-4c2c-bf67-421cb2811a98

📥 Commits

Reviewing files that changed from the base of the PR and between e669fd5 and 9b400bd.

📒 Files selected for processing (13)
  • .github/workflows/Auto-Assign.yml
  • .github/workflows/Build External Help.yml
  • .github/workflows/Build Module.yml
  • .github/workflows/Deploy Zensical.yml
  • .github/workflows/Format Markdown.yml
  • .github/workflows/Publish Release.yml
  • .github/workflows/Update MkDocs Navigation.yml
  • .github/workflows/Validate Module Manifest.yml
  • .github/workflows/Validate Zensical.yml
  • .github/workflows/codacy.yml
  • .github/workflows/dependency-review.yml
  • .github/workflows/scorecard.yml
  • .github/workflows/summary.yml

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


📝 Walkthrough

Walkthrough

Changes

Workflow controls and release automation

Layer / File(s) Summary
Job execution limits
.github/workflows/Auto-Assign.yml, .github/workflows/Build External Help.yml, .github/workflows/Build Module.yml, .github/workflows/Format Markdown.yml, .github/workflows/Update MkDocs Navigation.yml, .github/workflows/Validate Module Manifest.yml, .github/workflows/codacy.yml, .github/workflows/dependency-review.yml, .github/workflows/summary.yml
Explicit job timeouts were added. The Codacy action reference gained a version comment.
Trigger and runner controls
.github/workflows/Build External Help.yml, .github/workflows/Format Markdown.yml, .github/workflows/Validate Module Manifest.yml, .github/workflows/Deploy Zensical.yml, .github/workflows/Validate Zensical.yml, .github/workflows/scorecard.yml
Workflow triggers and conditions were narrowed. Runner egress auditing was added to deployment and documentation validation jobs.
Release publication flow
.github/workflows/Publish Release.yml
Release publishing now uses version tags, extracts matching changelog sections, applies scoped write permission, and attaches ZIP artifacts with softprops/action-gh-release.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant GitHub as GitHub tag event
  participant Workflow as Publish Release workflow
  participant Changelog as Changelog extraction step
  participant Release as softprops/action-gh-release
  participant Artifacts as ZIP artifacts
  GitHub->>Workflow: Start for v*.*.* tag
  Workflow->>Changelog: Extract matching section
  Changelog-->>Workflow: Write RELEASE_NOTES.md
  Workflow->>Artifacts: Select ZIP files
  Workflow->>Release: Create release with notes and assets
Loading

Merge Risk: ⚪ Minimal · up to 9b400

The workflow changes have no identified merge-blocking defect.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: security hardening and optimization of GitHub Actions workflows.
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…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch samerde-review-gh-actions-workflows

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.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

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

OpenSSF Scorecard

PackageVersionScoreDetails
actions/step-security/harden-runner e14015d583714f6e62063499dc959a02595150a1 🟢 7.8
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection🟢 8branch protection is not maximal on development and all release branches
CI-Tests🟢 106 out of 6 merged PRs checked by a CI test -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Code-Review🟢 10all changesets reviewed
Contributors🟢 6project has 2 contributing companies or organizations -- score normalized to 6
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Dependency-Update-Tool🟢 10update tool detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Maintained🟢 1030 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 6dependency not pinned by hash detected -- score normalized to 6
SAST🟢 9SAST tool detected but not run on all commits
Security-Policy🟢 10security policy file detected
Signed-Releases⚠️ -1no releases found
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Vulnerabilities⚠️ 022 existing vulnerabilities detected
actions/step-security/harden-runner e14015d583714f6e62063499dc959a02595150a1 🟢 7.8
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection🟢 8branch protection is not maximal on development and all release branches
CI-Tests🟢 106 out of 6 merged PRs checked by a CI test -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Code-Review🟢 10all changesets reviewed
Contributors🟢 6project has 2 contributing companies or organizations -- score normalized to 6
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Dependency-Update-Tool🟢 10update tool detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Maintained🟢 1030 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 6dependency not pinned by hash detected -- score normalized to 6
SAST🟢 9SAST tool detected but not run on all commits
Security-Policy🟢 10security policy file detected
Signed-Releases⚠️ -1no releases found
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Vulnerabilities⚠️ 022 existing vulnerabilities detected

Scanned Files

  • .github/workflows/Deploy Zensical.yml
  • .github/workflows/Validate Zensical.yml

@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 chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b400bd565

ℹ️ 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".

Comment thread .github/workflows/Publish Release.yml Resolved
Publish Release.yml referenced artifacts/**/*.zip and src/Archive/**/*.zip
without ever producing them in this workflow, so softprops/action-gh-release
would silently create a release with no attached package. Add the bootstrap +
Invoke-Build steps (matching Build Module.yml) to actually build and archive
the module first, point at the real output path, and set
fail_on_unmatched_files: true so this can't silently regress again.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec3088a927

ℹ️ 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".

Comment thread .github/workflows/Publish Release.yml Resolved
Splitting the Invoke-Build call into pre-Archive tasks + an explicit
cleanup step + the Archive task so Artifacts/ccReport and
Artifacts/testOutput (Pester/coverage output) are removed before the
release zip is created, keeping CI reports out of the published package.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@SamErde
SamErde merged commit 9d41e5b into main Sep 14, 2026
16 checks passed
@SamErde
SamErde deleted the samerde-review-gh-actions-workflows branch September 14, 2026 16:13
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.

1 participant