Skip to content

Commit 24d40d5

Browse files
committed
Complete rewrite to integrate with Witness for attestation
1 parent dc10bbb commit 24d40d5

File tree

5 files changed

+660
-453
lines changed

5 files changed

+660
-453
lines changed

.github/workflows/test.yml

Lines changed: 35 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Wrapper Action
1+
name: Test Witness Action Wrapper
22

33
on:
44
push:
@@ -21,59 +21,29 @@ jobs:
2121
- name: Install dependencies
2222
run: npm ci
2323

24-
- name: Test wrapper with a simple action (no wrapper)
24+
- name: Test wrapper with basic attestation
25+
id: attestation
2526
uses: ./
2627
with:
28+
# Action to run
2729
action-ref: "actions/hello-world-javascript-action@main"
28-
enable-wrapper: "false"
2930
input-who-to-greet: "World"
30-
31-
test-strace:
32-
runs-on: ubuntu-latest
33-
steps:
34-
- name: Checkout repository
35-
uses: actions/checkout@v3
36-
37-
- name: Setup Node.js
38-
uses: actions/setup-node@v3
39-
with:
40-
node-version: '16'
41-
42-
- name: Install dependencies
43-
run: npm ci
44-
45-
- name: Install strace and set permissions
46-
run: |
47-
sudo apt-get update
48-
sudo apt-get install -y strace
49-
# Set permissions to allow strace to work without privilege issues
50-
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope || true
51-
52-
- name: Test wrapper with strace
53-
id: strace-test
54-
uses: ./
55-
with:
56-
action-ref: "actions/hello-world-javascript-action@main"
57-
wrapper-command: "strace -f -v -s 256 -e trace=file,process,network,signal,ipc,desc,memory"
58-
input-who-to-greet: "Strace"
59-
60-
- name: Check strace output
31+
32+
# Witness configuration
33+
step: "hello-world"
34+
attestations: "command"
35+
36+
- name: Check attestation file
6137
run: |
62-
if [ -f "${{ steps.strace-test.outputs.wrapper-log }}" ]; then
63-
echo "Wrapper log file exists at ${{ steps.strace-test.outputs.wrapper-log }}"
64-
head -n 20 "${{ steps.strace-test.outputs.wrapper-log }}"
38+
if [[ -f "/tmp/hello-world-attestation.json" ]]; then
39+
echo "Attestation created successfully"
40+
jq . "/tmp/hello-world-attestation.json" | head -n 20
6541
else
66-
echo "Wrapper log file not found!"
42+
echo "Attestation file not found!"
6743
exit 1
6844
fi
69-
70-
- name: Upload strace logs as artifact
71-
uses: actions/upload-artifact@v4
72-
with:
73-
name: strace-logs
74-
path: ${{ steps.strace-test.outputs.wrapper-log }}
75-
76-
test-time:
45+
46+
test-multi-attestors:
7747
runs-on: ubuntu-latest
7848
steps:
7949
- name: Checkout repository
@@ -86,27 +56,33 @@ jobs:
8656

8757
- name: Install dependencies
8858
run: npm ci
89-
90-
- name: Test wrapper with time command
91-
id: time-test
59+
60+
- name: Test wrapper with multiple attestors
61+
id: multi-attestation
9262
uses: ./
9363
with:
64+
# Action to run
9465
action-ref: "actions/hello-world-javascript-action@main"
95-
wrapper-command: "time -v"
96-
input-who-to-greet: "Time"
66+
input-who-to-greet: "Witness"
67+
68+
# Witness configuration
69+
step: "hello-world-multi"
70+
attestations: "command attestor.git attestor.sbom"
71+
attestor-sbom-export: "true"
72+
outfile: "./multi-attestation.json"
9773

98-
- name: Check time output
74+
- name: Check attestation file
9975
run: |
100-
if [ -f "${{ steps.time-test.outputs.wrapper-log }}" ]; then
101-
echo "Time log file exists at ${{ steps.time-test.outputs.wrapper-log }}"
102-
cat "${{ steps.time-test.outputs.wrapper-log }}"
76+
if [[ -f "./multi-attestation.json" ]]; then
77+
echo "Multi-attestation created successfully"
78+
jq . "./multi-attestation.json" | head -n 20
10379
else
104-
echo "Time log file not found!"
80+
echo "Multi-attestation file not found!"
10581
exit 1
10682
fi
10783
108-
- name: Upload time logs as artifact
84+
- name: Upload attestation as artifact
10985
uses: actions/upload-artifact@v4
11086
with:
111-
name: time-logs
112-
path: ${{ steps.time-test.outputs.wrapper-log }}
87+
name: attestation-files
88+
path: ./multi-attestation.json

0 commit comments

Comments
 (0)