This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed
Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -358,12 +358,10 @@ where
358358 let uses = step_uses ( de) ?;
359359
360360 match uses {
361- Uses :: Local ( local) if local. git_ref . is_none ( ) => Err ( de:: Error :: custom (
362- "local action must have `@<ref>` in reusable workflow" ,
363- ) ) ,
364361 Uses :: Repository ( repo) if repo. git_ref . is_none ( ) => Err ( de:: Error :: custom (
365362 "repo action must have `@<ref> in reusable workflow" ,
366363 ) ) ,
364+ // NOTE: local reusable workflows do not have to be pinned.
367365 Uses :: Local ( _) => Ok ( uses) ,
368366 Uses :: Repository ( _) => Ok ( uses) ,
369367 // `docker://` is never valid in reusable workflow uses.
Original file line number Diff line number Diff line change 1+ # see https://github.com/woodruffw/zizmor/issues/431
2+
3+ name : " reusable-workflow-unpinned"
4+
5+ on :
6+ push :
7+
8+ jobs :
9+ testcase :
10+ name : " testcase"
11+ uses : ./.github/workflows/reusable.yml
Original file line number Diff line number Diff line change @@ -24,10 +24,12 @@ fn load_workflow(name: &str) -> Workflow {
2424fn test_load_all ( ) {
2525 let sample_workflows = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "tests/sample-workflows" ) ;
2626
27- for sample_action in std:: fs:: read_dir ( sample_workflows) . unwrap ( ) {
28- let sample_workflow = sample_action. unwrap ( ) . path ( ) ;
29- let workflow_contents = std:: fs:: read_to_string ( sample_workflow) . unwrap ( ) ;
30- serde_yaml:: from_str :: < Workflow > ( & workflow_contents) . unwrap ( ) ;
27+ for sample_workflow in std:: fs:: read_dir ( sample_workflows) . unwrap ( ) {
28+ let sample_workflow = sample_workflow. unwrap ( ) . path ( ) ;
29+ let workflow_contents = std:: fs:: read_to_string ( & sample_workflow) . unwrap ( ) ;
30+
31+ let wf = serde_yaml:: from_str :: < Workflow > ( & workflow_contents) ;
32+ assert ! ( wf. is_ok( ) , "failed to parse {sample_workflow:?}" ) ;
3133 }
3234}
3335
You can’t perform that action at this time.
0 commit comments