-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, hub mirror action didn't have availablilty to sync the repos with different name, such as the requirement like #45 #64, the user want to sync github `xxx.github.com` repo to gitee repo `xxx`. This patch adds the support for mappings, actually, accurately, it's the source repo mappings. The repo name will do the mapping covert according the mappings. The compelete demo looks like: ``` - name: mirror with mappings uses: Yikun/hub-mirror-action@mappings with: src: github/yikun dst: gitee/yikunkero dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} dst_token: ${{ secrets.GITEE_TOKEN }} mappings: "yikun.github.com=>blog" static_list: "yikun.github.com" ``` It will sync the `github.com/yikun/yikun.github.com` to `gitee.com/yikunkero/blog` Closes: #45 Closes: #64
- Loading branch information
Showing
9 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import unittest | ||
from utils import str2map | ||
|
||
|
||
class TestUtils(unittest.TestCase): | ||
|
||
def test_str2map(self): | ||
self.assertEqual(str2map("a=>b, c=>d"), {'a': 'b', 'c': 'd'}) | ||
self.assertEqual(str2map("a=>b,c=>d"), {'a': 'b', 'c': 'd'}) | ||
# No transitivity | ||
self.assertEqual(str2map("cc=>c,c=>d"), {'cc': 'c', 'c': 'd'}) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters