Skip to content

Commit aeaed13

Browse files
fix(build): resolve scorecard badge and workflow security issues (#301)
## Description This PR fixes the broken OpenSSF Scorecard badge by removing a `run:` step from the scorecard workflow that violated ossf/scorecard-action restrictions. Additionally, it addresses workflow security configurations by adding explicit permission blocks and pinning npm dependencies to specific versions. - Removed job summary step from scorecard.yml that used `run:` commands, which caused workflow verification failures and prevented the Scorecard API from accepting results - Added explicit `permissions: contents: read` block to pester-tests.yml to satisfy scorecard token permissions requirements - Removed redundant `security-events: write` from security-scan.yml top-level permissions (already declared at job level) - Pinned `@vscode/[email protected]` in extension-publish-prerelease.yml (two locations) to address npm dependency pinning requirements ## Related Issue(s) Closes #300 Closes #292 Closes #291 ## Type of Change Select all that apply: **Code & Documentation:** - [x] Bug fix (non-breaking change fixing an issue) - [ ] New feature (non-breaking change adding functionality) - [ ] Breaking change (fix or feature causing existing functionality to change) - [ ] Documentation update **Infrastructure & Configuration:** - [x] GitHub Actions workflow - [ ] Linting configuration (markdown, PowerShell, etc.) - [x] Security configuration - [ ] DevContainer configuration - [x] Dependency update **AI Artifacts:** - [ ] Reviewed contribution with `prompt-builder` agent and addressed all feedback - [ ] Copilot instructions (`.github/instructions/*.instructions.md`) - [ ] Copilot prompt (`.github/prompts/*.prompt.md`) - [ ] Copilot agent (`.github/agents/*.agent.md`) > **Note for AI Artifact Contributors**: > > - **Agents**: Research, indexing/referencing other project (using standard VS Code GitHub Copilot/MCP tools), planning, and general implementation agents likely already exist. Review `.github/agents/` before creating new ones. > - **Model Versions**: Only contributions targeting the **latest Anthropic and OpenAI models** will be accepted. Older model versions (e.g., GPT-3.5, Claude 3) will be rejected. > - See [Agents Not Accepted](../docs/contributing/custom-agents.md#agents-not-accepted) and [Model Version Requirements](../docs/contributing/ai-artifacts-common.md#model-version-requirements). **Other:** - [ ] Script/automation (`.ps1`, `.sh`, `.py`) - [ ] Other (please describe): ## Testing - Ran `npm run lint:yaml` to validate all 21 workflow files pass YAML/actionlint checks - Verified workflow syntax is valid for all modified files ## Checklist ### Required Checks - [x] Documentation is updated (if applicable) - [x] Files follow existing naming conventions - [x] Changes are backwards compatible (if applicable) - [ ] Tests added for new functionality (if applicable) ### AI Artifact Contributions N/A - No AI artifacts in this PR. ### Required Automated Checks The following validation commands must pass before merging: - [ ] Markdown linting: `npm run lint:md` - [ ] Spell checking: `npm run spell-check` - [ ] Frontmatter validation: `npm run lint:frontmatter` - [ ] Link validation: `npm run lint:md-links` - [ ] PowerShell analysis: `npm run lint:ps` ## Security Considerations - [x] This PR does not contain any sensitive or NDA information - [ ] Any new dependencies have been reviewed for security issues - [x] Security-related scripts follow the principle of least privilege ## Additional Notes The root cause of the broken scorecard badge was the `run:` step in scorecard.yml. The ossf/scorecard-action explicitly restricts workflows containing arbitrary shell commands to prevent supply chain attacks, which caused all workflow runs to fail verification and return empty results to the Scorecard API. 🔧 Generated by Copilot
1 parent a390e26 commit aeaed13

4 files changed

Lines changed: 5 additions & 14 deletions

File tree

.github/workflows/extension-publish-prerelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
node-version: '20'
6969

7070
- name: Install VSCE
71-
run: npm install -g @vscode/vsce
71+
run: npm install -g @vscode/vsce@3.7.1
7272

7373
- name: Setup PowerShell
7474
shell: pwsh
@@ -126,7 +126,7 @@ jobs:
126126
node-version: '20'
127127

128128
- name: Install VSCE
129-
run: npm install -g @vscode/vsce
129+
run: npm install -g @vscode/vsce@3.7.1
130130

131131
- name: Download VSIX artifact
132132
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0

.github/workflows/pester-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
type: boolean
2020
default: false
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
pester:
2427
name: PowerShell Tests

.github/workflows/scorecard.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,3 @@ jobs:
4444
name: scorecard-results
4545
path: results.sarif
4646
retention-days: 90
47-
48-
- name: Add job summary
49-
if: always()
50-
run: |
51-
{
52-
echo "## OpenSSF Scorecard Analysis Complete"
53-
echo ""
54-
echo "📊 View results in the Security tab under Code Scanning"
55-
echo ""
56-
echo "🏆 [View Scorecard Badge](https://scorecard.dev/viewer/?uri=github.com/microsoft/hve-core)"
57-
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/security-scan.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66

77
permissions:
88
contents: read
9-
security-events: write
109

1110
jobs:
1211
codeql:

0 commit comments

Comments
 (0)