@@ -144,29 +144,23 @@ impl Artipacked {
144144 /// Create a Fix for setting persist-credentials: false
145145 fn create_persist_credentials_fix < ' doc > ( step : & impl StepCommon < ' doc > ) -> Fix < ' doc > {
146146 Fix {
147- title : "Set persist-credentials: false" . to_string ( ) ,
148- description : "To prevent credential persistence, set 'persist-credentials: false' in this checkout step. \
149- When 'persist-credentials' is true (the default), the GITHUB_TOKEN persists in the local git config \
150- after checkout, which may be inadvertently leaked through subsequent actions like artifact uploads. \
151- Setting 'persist-credentials: false' ensures that credentials don't persist beyond the checkout step itself.". to_string ( ) ,
147+ title : "set persist-credentials: false" . to_string ( ) ,
152148 key : step. location ( ) . key ,
153149 disposition : Default :: default ( ) ,
154- patches : vec ! [
155- Patch {
156- route: step. route( ) ,
157- operation: Op :: MergeInto {
158- key: "with" . to_string( ) ,
159- value: {
160- let mut with_map = serde_yaml:: Mapping :: new( ) ;
161- with_map. insert(
162- serde_yaml:: Value :: String ( "persist-credentials" . to_string( ) ) ,
163- serde_yaml:: Value :: Bool ( false ) ,
164- ) ;
165- serde_yaml:: Value :: Mapping ( with_map)
166- } ,
150+ patches : vec ! [ Patch {
151+ route: step. route( ) ,
152+ operation: Op :: MergeInto {
153+ key: "with" . to_string( ) ,
154+ value: {
155+ let mut with_map = serde_yaml:: Mapping :: new( ) ;
156+ with_map. insert(
157+ serde_yaml:: Value :: String ( "persist-credentials" . to_string( ) ) ,
158+ serde_yaml:: Value :: Bool ( false ) ,
159+ ) ;
160+ serde_yaml:: Value :: Mapping ( with_map)
167161 } ,
168- }
169- ] ,
162+ } ,
163+ } ] ,
170164 }
171165 }
172166}
@@ -239,7 +233,7 @@ mod tests {
239233 assert ! ( !finding. fixes. is_empty( ) , "Expected fixes but got none" ) ;
240234
241235 let fix = & finding. fixes [ 0 ] ;
242- assert_eq ! ( fix. title, "Set persist-credentials: false" ) ;
236+ assert_eq ! ( fix. title, "set persist-credentials: false" ) ;
243237
244238 fix. apply ( document) . unwrap ( )
245239 }
@@ -248,14 +242,14 @@ mod tests {
248242 fn test_fix_title_and_description ( ) {
249243 // Test that the fix has the expected title and description format
250244 // Since Step::new is private, we test this indirectly through the audit logic
251- let title = "Set persist-credentials: false" ;
245+ let title = "set persist-credentials: false" ;
252246 let description_keywords = [
253247 "persist-credentials" ,
254248 "GITHUB_TOKEN" ,
255249 "credential persistence" ,
256250 ] ;
257251
258- assert_eq ! ( title, "Set persist-credentials: false" ) ;
252+ assert_eq ! ( title, "set persist-credentials: false" ) ;
259253 for keyword in description_keywords {
260254 // This is a basic smoke test - in practice, integration tests would verify the fix works
261255 assert ! ( !keyword. is_empty( ) ) ;
0 commit comments