File tree Expand file tree Collapse file tree 5 files changed +33
-5
lines changed Expand file tree Collapse file tree 5 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 37
37
- name : Verify artifact signature
38
38
run : |
39
39
sigstore verify --certificate ./test/artifact.txt.crt --signature ./test/artifact.txt.sig --staging ./test/artifact.txt
40
+
41
+ selftest-glob :
42
+ runs-on : ubuntu-latest
43
+ steps :
44
+ - uses : actions/checkout@v3
45
+ - name : Sign artifacts and publish signatures
46
+ uses : ./
47
+ id : sigstore-python
48
+ with :
49
+ inputs : ./test/*.txt
50
+ - name : Verify artifact signatures
51
+ run : |
52
+ sigstore verify ./test/artifact.txt ./test/artifact1.txt ./test/artifact2.txt
Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ To sign one or more files:
50
50
inputs: file0.txt file1.txt file2.txt
51
51
` ` `
52
52
53
+ The `inputs` argument also supports file globbing :
54
+
55
+ ` ` ` yaml
56
+ - uses: trailofbits/[email protected]
57
+ with:
58
+ inputs: ./path/to/inputs/*.txt
59
+ ` ` `
60
+
53
61
# ## `oidc-client-id`
54
62
55
63
**Default**: `sigstore`
Original file line number Diff line number Diff line change 8
8
import os
9
9
import subprocess
10
10
import sys
11
+ from glob import glob
11
12
from pathlib import Path
12
13
13
14
_OUTPUTS = [sys .stderr ]
@@ -43,7 +44,7 @@ def _fatal_help(msg):
43
44
sys .exit (1 )
44
45
45
46
46
- inputs = [ Path ( p ). resolve () for p in sys .argv [1 ].split ()]
47
+ inputs = sys .argv [1 ].split ()
47
48
summary = Path (os .getenv ("GITHUB_STEP_SUMMARY" )).open ("a" )
48
49
49
50
# The arguments we pass into `sigstore-python` get built up in this list.
@@ -103,12 +104,16 @@ def _fatal_help(msg):
103
104
for input_ in inputs :
104
105
# Forbid things that look like flags. This isn't a security boundary; just
105
106
# a way to prevent (less motivated) users from breaking the action on themselves.
106
- if str ( input_ ) .startswith ("-" ):
107
+ if input_ .startswith ("-" ):
107
108
_fatal_help (f"input { input_ } looks like a flag" )
108
109
109
- if not input_ .is_file ():
110
- _fatal_help (f"input { input_ } does not look like a file" )
111
- sigstore_python_args .append (input_ )
110
+ files = [Path (f ).resolve () for f in glob (input_ )]
111
+
112
+ for file_ in files :
113
+ if not file_ .is_file ():
114
+ _fatal_help (f"input { file_ } does not look like a file" )
115
+
116
+ sigstore_python_args .extend (files )
112
117
113
118
_debug (f"running: sigstore-python { [str (a ) for a in sigstore_python_args ]} " )
114
119
Original file line number Diff line number Diff line change
1
+ Hello, World 1!
Original file line number Diff line number Diff line change
1
+ Hello, World 2!
You can’t perform that action at this time.
0 commit comments