Skip to content

Commit e5d6c55

Browse files
committed
Add attestation
1 parent f12c98c commit e5d6c55

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.github/workflows/tests.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- main
77
- dev
88

9+
permissions:
10+
id-token: write
11+
attestations: write
12+
913
jobs:
1014
build:
1115
runs-on: windows-latest
@@ -16,9 +20,21 @@ jobs:
1620
uses: ./
1721
with:
1822
sourceDir: "./tests"
19-
- name: "Upload Artifact"
23+
- name: "Upload Build Artifact"
2024
uses: actions/upload-artifact@v4
25+
id: "upload"
2126
with:
22-
name: "VBA-Enabled Workbook"
27+
name: "VBA-Enabled-Documents"
2328
path: "./tests/out/*"
24-
if-no-files-found: warn
29+
if-no-files-found: warn
30+
- name: "Upload Screenshots"
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: "Screenshots"
34+
path: "./tests/screenshots/*"
35+
if-no-files-found: warn
36+
- name: "Attestation"
37+
uses: actions/attest-build-provenance@v2
38+
with:
39+
subject-name: "VBA-Enabled-Documents"
40+
subject-digest: sha256:${{ steps.upload.outputs.artifact-digest }}

scripts/Build-VBA.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if (-not (Test-VBOMAccess -officeAppName $officeAppName)) {
8080
$officeApp = New-Object -ComObject "$officeAppName.Application"
8181

8282
# Make app visible (uncomment if needed)
83-
# $officeApp.Visible = $true
83+
$officeApp.Visible = $true
8484

8585
# Check if the application instance was created successfully
8686
if ($null -eq $officeApp) {
@@ -159,7 +159,12 @@ $basFiles | ForEach-Object {
159159
# Take a screenshot of the Office application
160160
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
161161
. "$scriptPath/utils/Screenshot.ps1"
162-
Take-Screenshot -OutputPath "${outputDir}Screenshot_${fileNameNoExt}.png"
162+
$screenshotDir = (DirUp $outputDir) + "/screenshots"
163+
if (-not (Test-Path $screenshotDir)) {
164+
New-Item -ItemType Directory -Path $screenshotDir -Force | Out-Null
165+
Write-Host "Created screenshot directory: $screenshotDir"
166+
}
167+
Take-Screenshot -OutputPath "${$screenshotDir}Screenshot_${fileNameNoExt}.png"
163168

164169
# Save the document
165170
$doc.Save()

0 commit comments

Comments
 (0)