File tree 1 file changed +12
-1
lines changed 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -732,9 +732,16 @@ impl UpdateRepoDiff {
732
732
return Ok ( ( ) ) ;
733
733
}
734
734
735
- if self . settings_diff . 0 != self . settings_diff . 1 {
735
+ // If we're unarchiving, we have to unarchive first and *then* modify other properties
736
+ // of the repository. On the other hand, if we're achiving, we need to perform
737
+ // the archiving *last* (otherwise permissions and branch protections cannot be modified)
738
+ // anymore. If we're not changing the archival status, the order doesn't really matter.
739
+ let is_unarchive = self . settings_diff . 0 . archived && !self . settings_diff . 1 . archived ;
740
+
741
+ if is_unarchive {
736
742
sync. edit_repo ( & self . org , & self . name , & self . settings_diff . 1 ) ?;
737
743
}
744
+
738
745
for permission in & self . permission_diffs {
739
746
permission. apply ( sync, & self . org , & self . name ) ?;
740
747
}
@@ -743,6 +750,10 @@ impl UpdateRepoDiff {
743
750
branch_protection. apply ( sync, & self . org , & self . name , & self . repo_node_id ) ?;
744
751
}
745
752
753
+ if !is_unarchive && self . settings_diff . 0 != self . settings_diff . 1 {
754
+ sync. edit_repo ( & self . org , & self . name , & self . settings_diff . 1 ) ?;
755
+ }
756
+
746
757
Ok ( ( ) )
747
758
}
748
759
}
You can’t perform that action at this time.
0 commit comments