Skip to content

Commit 80238ac

Browse files
Potential fix for code scanning alerts: Workflow does not contain permissions (#17)
* Potential fix for code scanning alert no. 1: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Potential fix for code scanning alert no. 2: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Update pr-build.yml to exclude test results if not a push Permissions are tightened to the point that the Publish test results step will fail on a PR now. It wouldn't do anything for a PR build in the past (except waste CPU cycles) So, this fix just skips the step entirely for PR builds. * Update pr-build.yml to fix syntax Updated syntax of condition cuz, ya know. it's not like there's anything to catch errors ahead of time... [Sigh!] 🤦 --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 8fe2074 commit 80238ac

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/workflows/pr-build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: CI-Build
2+
permissions:
3+
contents: read
24
defaults:
35
run:
46
shell: pwsh
@@ -38,6 +40,7 @@ jobs:
3840

3941
- name: Publish Test Results
4042
uses: EnricoMi/publish-unit-test-result-action/windows@v2
43+
if: ${{ github.event_name == 'push' }}
4144
with:
4245
files: BuildOutput/Test-Results/*.trx
4346

.github/workflows/release-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
name: Release-Build
2+
permissions:
3+
contents: write
4+
pages: write
5+
packages: write
6+
actions: read
27
defaults:
38
run:
49
shell: pwsh

0 commit comments

Comments
 (0)