Skip to content

[Build] Remove sudo from prebuild script and harden GitHub Actions workflows - #172

Merged
cyhuang1230 merged 2 commits into
mainfrom
fix-triage-issues
Sep 22, 2026
Merged

cyhuang1230 merged 2 commits into
mainfrom
fix-triage-issues

Conversation

@cyhuang1230

Copy link
Copy Markdown
Collaborator

Summary

  • Remove sudo from prebuild script (diagnostics-extension/package.json):
    • Replace "prebuild": "sudo rm -rf build/" with "prebuild": "rm -rf build/" so cleaning the local build directory does not request root privileges during npm run build / npm run dev.
  • Harden GitHub Actions workflows (.github/workflows/angular.test.yml, .github/workflows/extension.test.yml):
    • Pin actions/checkout, actions/setup-node, and codecov/codecov-action to immutable v4 40-character commit SHAs.
    • Add top-level permissions: contents: read to restrict GITHUB_TOKEN to read-only repository access.

Testing

  • npm run script:ci in diagnostics-extension (webpack build, tsc, jest 36/36 unit tests, and gts lint passing)

Do not invoke sudo when cleaning the local build directory in the diagnostics-extension npm prebuild lifecycle hook.
Pin actions/checkout, actions/setup-node, and codecov/codecov-action to immutable v4 commit SHAs and declare explicit read-only contents permissions in CI workflows.

@BaiiYuan BaiiYuan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@cyhuang1230
cyhuang1230 merged commit bac4da8 into main Sep 22, 2026
11 checks passed
@cyhuang1230
cyhuang1230 deleted the fix-triage-issues branch September 22, 2026 04:52
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.

2 participants