Compare commits
1329 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 773744901b | |||
| 8b423c6fac | |||
| 3ac8a744e4 | |||
| e430cfc2fc | |||
| 99f9378b47 | |||
| 2216b3aa26 | |||
| 482d7fd7d6 | |||
| c2da581914 | |||
| 76f84622bc | |||
| 246151aa30 | |||
| eb0a404705 | |||
| 436d8efa4c | |||
| d2ad0de260 | |||
| c6b90f93cb | |||
| 20665dd134 | |||
| 8a03a65ab9 | |||
| 8d4420ab75 | |||
| 14ca6a4b49 | |||
| 283f17cccc | |||
| 0607099d6a | |||
| 9bff39e005 | |||
| f02e40f8ac | |||
| 797883c7cc | |||
| a168248bf4 | |||
| 813b89b687 | |||
| da6e6f78b7 | |||
| aa90be19b3 | |||
| 513087bc4f | |||
| 1419e402bb | |||
| 0db00dfb01 | |||
| d5ecf98649 | |||
| 69f7b3174f | |||
| 78718f94d6 | |||
| 9429b3bc0f | |||
| f35cc7b22e | |||
| cd90ead742 | |||
| 0df83a7c62 | |||
| e8c7f253b4 | |||
| ddfea1aff0 | |||
| 754747fca7 | |||
| 487e475c40 | |||
| 45705bf499 | |||
| 49898e67b8 | |||
| 4fd9ae4d9b | |||
| f7c6602941 | |||
| d2061ba45b | |||
| ce4aee291a | |||
| 885e744192 | |||
| 52e5976aed | |||
| 813ebceea4 | |||
| 9a2b56befc | |||
| e6d24883ad | |||
| 983d440620 | |||
| cc9d2d7967 | |||
| 5b241ae39e | |||
| f7b3b9766a | |||
| 6a6c10452a | |||
| 1d9bd96cc2 | |||
| 51afe4c253 | |||
| baa7203ed6 | |||
| 984890f228 | |||
| 46530777f2 | |||
| 74dc329c07 | |||
| f6fe57d669 | |||
| 91b5bf387e | |||
| faaf52818d | |||
| e39079643f | |||
| 1b19b68425 | |||
| 1125c50abd | |||
| 05d9fdbad3 | |||
| 0dbe58c83e | |||
| 67d0dec7b0 | |||
| e0c6a281ea | |||
| a1aa389b82 | |||
| e956b6a9c6 | |||
| f17f0d5f43 | |||
| f3acd22208 | |||
| 00a29bb28d | |||
| 285599a999 | |||
| cd2bb47676 | |||
| 6057416b97 | |||
| 7a6decbd29 | |||
| 343ce8195b | |||
| cb92881573 | |||
| cce8920b20 | |||
| e24be28b0d | |||
| 52423e0164 | |||
| 763ac0a78d | |||
| 93f73efc7c | |||
| 8ba961d184 | |||
| cb05e8f646 | |||
| f4e644b580 | |||
| 4945e413ca | |||
| 2fbc489f84 | |||
| df4b0fd610 | |||
| 5510af857c | |||
| d45be448d0 | |||
| 5e47feccc4 | |||
| 310a22c94d | |||
| ccc5b85fd7 | |||
| e30fffa622 | |||
| 6d2c93fc92 | |||
| f87ad1d4f4 | |||
| 4e99dcb6ae | |||
| 4d6ca2e475 | |||
| 4db656433a | |||
| b32afc3536 | |||
| e452884386 | |||
| c82a17a45a | |||
| 31881fdf56 | |||
| 3fe7fe4ef9 | |||
| 0805ef7e1b | |||
| ae6d6be6b8 | |||
| f9d6838b01 | |||
| 706583bf77 | |||
| 349d91086a | |||
| daa4a82a0a | |||
| bc311d9e7c | |||
| f899edf375 | |||
| 6f9e0548a9 | |||
| cb29485b25 | |||
| 777c62dfc9 | |||
| 0a8297ee9c | |||
| 682b52c974 | |||
| 81ec0597b0 | |||
| 923b9dd8cc | |||
| 4ce37c7b90 | |||
| 02ba107525 | |||
| 216e1f53d1 | |||
| e4e1f949b9 | |||
| 30f482a789 | |||
| 19bc025a17 | |||
| 6f0c8933f4 | |||
| 1c773fd78a | |||
| 35b0b9fc23 | |||
| 9303442717 | |||
| cb160e71db | |||
| d04d557b1c | |||
| 4909d28a9d | |||
| c1a9cc8d87 | |||
| f24a1c8c30 | |||
| 44e0bad810 | |||
| 182fb2a468 | |||
| ec21df156a | |||
| 7b3e70514e | |||
| 806a03aee5 | |||
| 8c120334e9 | |||
| b61b9dcdb4 | |||
| 8cb68738a8 | |||
| f5339885c5 | |||
| debc36d8e8 | |||
| 5e2cda6390 | |||
| c6e000a943 | |||
| dbd89aff7e | |||
| 32226fa3a7 | |||
| 766e73518f | |||
| 11e8b924a8 | |||
| 96d63227d8 | |||
| 836b6bdbba | |||
| 0e9e857b73 | |||
| 9524d49185 | |||
| c96f24bee9 | |||
| c5659e27c3 | |||
| c45c16344f | |||
| a2cc348b2f | |||
| bda2233c87 | |||
| a5bf544832 | |||
| 6ab15c78b5 | |||
| d9a74d631e | |||
| f6b6795669 | |||
| 51d52c693b | |||
| 44819bf73d | |||
| f8dc75141b | |||
| 6eee22c768 | |||
| 4486228dfb | |||
| 5478b105dd | |||
| 5ccf2b0841 | |||
| 813f0f5dfa | |||
| fba6524d88 | |||
| c84757e7ec | |||
| 016f273161 | |||
| 736b8306bf | |||
| 73484870a9 | |||
| abf2a6c16e | |||
| 705e5f75d4 | |||
| c9dee1a48b | |||
| df51e8718f | |||
| 5ec44f8ee5 | |||
| 6e37533a39 | |||
| c86540bde2 | |||
| 87394da809 | |||
| 687a4e3db1 | |||
| f35a945d60 | |||
| f2afb14c94 | |||
| 3275b69dff | |||
| 921e0c5369 | |||
| 8ad558b49d | |||
| 5f60fa6c49 | |||
| d1c0d6e3ad | |||
| 5869b502b5 | |||
| b0431cb506 | |||
| 9b72269636 | |||
| d2373e87b5 | |||
| 6f9b2c744e | |||
| 1be02e3af3 | |||
| 9eb380ab80 | |||
| ceb8bf6a82 | |||
| 8d8b62bd9d | |||
| f645947c29 | |||
| dac6fbddf8 | |||
| efd662cb77 | |||
| 1e3eeb2cb0 | |||
| 518e9a6d63 | |||
| 331f8f5b42 | |||
| 5c844f7f55 | |||
| 989f9fa2e8 | |||
| 42b601df4a | |||
| 627a535fe3 | |||
| 85fbd23053 | |||
| 9ecb7199f1 | |||
| 76f17ea530 | |||
| b11ff05f74 | |||
| e141788034 | |||
| a7804b6007 | |||
| 548e8dee92 | |||
| b9643932c9 | |||
| b8d67bde7c | |||
| 81a21ce26c | |||
| b170385df7 | |||
| e7d3d29edc | |||
| ac58b1cc4f | |||
| 7964407813 | |||
| af19477c4a | |||
| bb0b1bbed7 | |||
| ab8450344f | |||
| 8eb06e7554 | |||
| 138fe50132 | |||
| 28b33595f5 | |||
| 1e94b651a5 | |||
| 187d0eb933 | |||
| 29976ccbd8 | |||
| 562e0d36f1 | |||
| ce1e7aac29 | |||
| d9f6cc7e1c | |||
| e1e80fbfdc | |||
| 8550b86c8e | |||
| 510997e8a7 | |||
| d0f616bf93 | |||
| 98283c713e | |||
| 3d69346b02 | |||
| b99f35152b | |||
| 05a4e5fa83 | |||
| 45996b0c3b | |||
| d4f32bce94 | |||
| c33907e28a | |||
| 33b7549701 | |||
| ecf222b9e6 | |||
| 523ec196e1 | |||
| 72bcf8d7e2 | |||
| 66ab2e883d | |||
| a4fbb16c46 | |||
| fbb1acf62e | |||
| 87faccd730 | |||
| 8c06c35481 | |||
| dac4c5b3a7 | |||
| 1b43699cd0 | |||
| 37801bfa6b | |||
| 7724c19a55 | |||
| d75b3f2b92 | |||
| fa92b15325 | |||
| 305ba7fe66 | |||
| 7f800d2875 | |||
| 1dcccc284e | |||
| 1ce25185f0 | |||
| 6823573dff | |||
| 8fe9d6e82d | |||
| a30a94ee4a | |||
| 8dc5a25643 | |||
| 769672aa04 | |||
| 2ac8afbe20 | |||
| e942546b90 | |||
| ba09bfbf96 | |||
| 3af7aa0ce1 | |||
| f3795e9780 | |||
| b74463f36c | |||
| 1255962a7a | |||
| 7551f40a33 | |||
| 4d2f64beb9 | |||
| e66500de53 | |||
| 095ea325f3 | |||
| e61b1c0758 | |||
| 6fa77dcbd2 | |||
| 252593987c | |||
| 4fbb09d1c7 | |||
| 86955a1497 | |||
| 4df8ac353c | |||
| b8f053bac6 | |||
| 5603b9bac0 | |||
| 0b5dad3055 | |||
| b13cfd98e0 | |||
| 3b3c56755a | |||
| 3fb41eefbe | |||
| 458d70226a | |||
| 346c4e232a | |||
| e53c34f3e6 | |||
| 683c4014a9 | |||
| 913a44e0fd | |||
| 63d187144e | |||
| b2c10ea85c | |||
| 1f9f607b8d | |||
| b538bde19b | |||
| a0659321ad | |||
| bd10dfa5db | |||
| 80e7dc67b8 | |||
| 932151f620 | |||
| 45cb0986bb | |||
| 48b509a3d6 | |||
| 6ba072608e | |||
| f48e249ca9 | |||
| a482e48d5f | |||
| 10e6a49141 | |||
| 9eeec5e39b | |||
| 050ce2a943 | |||
| fc65dc862f | |||
| 417bdd314b | |||
| c0a6640c49 | |||
| 9afd703495 | |||
| d5e4e76077 | |||
| 4cfa35d78d | |||
| 5d3898c8ec | |||
| 5d3fd13dcc | |||
| fd6774ee23 | |||
| 45b9860234 | |||
| 5648577bc7 | |||
| edd7358371 | |||
| 3eff3ac62b | |||
| 89c2622734 | |||
| 6c3d3576a2 | |||
| 6605bc0801 | |||
| 63d1780f1d | |||
| 525c5284cb | |||
| f34cdc2c3d | |||
| 8f51dc641f | |||
| f57c6e1db7 | |||
| ac0a15b3bc | |||
| 5d0ed2710c | |||
| 4972f3a7ed | |||
| 2c9c1e6b17 | |||
| bba4b73e1e | |||
| d786a14d86 | |||
| df6a4796ec | |||
| 800f54991d | |||
| ca4d8cd7d0 | |||
| 640489a996 | |||
| 33c3235b5b | |||
| 0af9cfb621 | |||
| cb5c88275d | |||
| d472676cb9 | |||
| edca47f336 | |||
| 680d2167b1 | |||
| ea94218be3 | |||
| ce0b2b4172 | |||
| 9655389e21 | |||
| ef94b487e3 | |||
| 1d76db3e50 | |||
| 17198eba68 | |||
| c29053ea33 | |||
| b86552ccc2 | |||
| 26c06b01aa | |||
| 2ce3bfe22f | |||
| 6f61e6af77 | |||
| 20004a6c23 | |||
| 0efcd77401 | |||
| f33c2c74d5 | |||
| 7e5711b0e7 | |||
| e2c90b4a69 | |||
| 830114bf8d | |||
| e07dbea671 | |||
| e5a6cfa3f3 | |||
| df76b2431e | |||
| f8a19c568e | |||
| 731343f9c8 | |||
| 116df7e0a8 | |||
| 32a070e9e4 | |||
| 40094fa826 | |||
| 0542b1169b | |||
| 74425ba90e | |||
| efaaab3fd4 | |||
| db8c408d3e | |||
| fddc8c9401 | |||
| 3910e18932 | |||
| 0677a40c92 | |||
| 5d9163e982 | |||
| 70643d5d13 | |||
| 0c604f544b | |||
| 669657ea64 | |||
| e1ce097ee5 | |||
| e5439e773a | |||
| f3e258cf1c | |||
| 077277a006 | |||
| 4335357ef8 | |||
| 5b42a895c5 | |||
| 7d0f200d8e | |||
| fa453cca7f | |||
| 0d92bca0a0 | |||
| 6b14fa66d4 | |||
| ffbb3e2fcc | |||
| 12f4ee1285 | |||
| e686dc088b | |||
| 45c5f83ea4 | |||
| c87a3ee8f8 | |||
| b0cdb6f833 | |||
| 375801bbdf | |||
| 19f99d7ed0 | |||
| 56666d093c | |||
| a16f6ff16d | |||
| 3dab7a8321 | |||
| 815b177174 | |||
| 170742353a | |||
| cb67306a83 | |||
| 8396983df9 | |||
| 563fade515 | |||
| b7bf953df7 | |||
| 4438dac304 | |||
| f6a2580ed5 | |||
| 3a69964ff4 | |||
| f7a1435a73 | |||
| 39859c4766 | |||
| dd4c8a0e0c | |||
| 99a69fcd0a | |||
| df32075808 | |||
| 8139bff71a | |||
| e647f685a5 | |||
| f21f977d02 | |||
| 23b42b17eb | |||
| bd55d2a06c | |||
| d645cbd7c2 | |||
| bd82fee1f0 | |||
| 02f5e12da6 | |||
| 4533c6d066 | |||
| 8717607c28 | |||
| ee6e2033ad | |||
| 8f0cecf38a | |||
| 90d941c945 | |||
| d17a2415d1 | |||
| 9c85757057 | |||
| 4a7b9f3a01 | |||
| b5ee3de2f2 | |||
| 15a2bd06fe | |||
| aee7d795b0 | |||
| 3bf0b5e861 | |||
| 95eacb66b8 | |||
| 9477bfc248 | |||
| 82ad393a3b | |||
| b6dc19c996 | |||
| 1a0a4b9d25 | |||
| 2a13c27c9e | |||
| a04d859f58 | |||
| 2fad7a2d74 | |||
| d95bbb70fe | |||
| 2720c78b22 | |||
| fbde1a705a | |||
| 140ee98601 | |||
| 28d9bc96af | |||
| 4ca7789d7b | |||
| cc532f6416 | |||
| 0ab2f5a1e5 | |||
| 1a447f0990 | |||
| 1430ba0e6b | |||
| e3dbc55b07 | |||
| b3045f55e4 | |||
| 2507993a50 | |||
| 7306ddc318 | |||
| 90d1d27426 | |||
| 625ddf478c | |||
| a2145293f3 | |||
| 0364928d38 | |||
| 56c84dd87d | |||
| 767399eb84 | |||
| 6ba9709b19 | |||
| d5e2194047 | |||
| 52b1c552b2 | |||
| 2366c3e2a9 | |||
| 07a9024220 | |||
| 2d3d57401a | |||
| 90c2a158e1 | |||
| 719f717de1 | |||
| b5ea0a9646 | |||
| d1f49308c0 | |||
| 315189785f | |||
| b32a4d5934 | |||
| 77458bf012 | |||
| 408c33f30c | |||
| 676531f9a5 | |||
| 05c850152c | |||
| 97ca5690ec | |||
| 335fbab037 | |||
| 272e28dee0 | |||
| c55f0438ba | |||
| 759c441ad5 | |||
| 087214861e | |||
| 6f75abf860 | |||
| 93337bf0ae | |||
| 776cc3af21 | |||
| d7bc2df2c6 | |||
| 92e25d5530 | |||
| 2d78537f2f | |||
| 306e011b5a | |||
| e16534fd36 | |||
| 3547730005 | |||
| 3c7736c04b | |||
| 0dabcbf5a1 | |||
| 901adcffc5 | |||
| a7e5945c2c | |||
| df70b4b8b7 | |||
| 5ef5588377 | |||
| 3ed4c5b9d8 | |||
| 00d4596b5b | |||
| 445d22f0c3 | |||
| 198382212a | |||
| 82a195859a | |||
| 6a0436d1aa | |||
| 16e5c15440 | |||
| e10f9a386b | |||
| ce2754bf79 | |||
| dccbdbe716 | |||
| cafeb3a8d4 | |||
| 211ebfbd1f | |||
| b6a6d5b8cf | |||
| 7a518d15fd | |||
| 2b6d281088 | |||
| 7a5229acf0 | |||
| c35a07502d | |||
| b04d3ec4d4 | |||
| 72c1e476cb | |||
| 73b5c7c9b9 | |||
| 1e8e5bf3e5 | |||
| 26551eac41 | |||
| 316d491c26 | |||
| dadbe89de1 | |||
| 17db3d5bd2 | |||
| 7748c8f507 | |||
| daa4d0a60e | |||
| 7bc04f632b | |||
| d21dd374a4 | |||
| 8e8e94e283 | |||
| db86f66e44 | |||
| 11ff981119 | |||
| 13bd4bb764 | |||
| 836160460c | |||
| f6d6e57f41 | |||
| 6b2f304cc4 | |||
| e9e2a5b7a3 | |||
| 13022114b5 | |||
| f466f96383 | |||
| 2f10a80d12 | |||
| 416c6770e9 | |||
| ab2e48d202 | |||
| 2602701459 | |||
| f61b6cf21e | |||
| 4aa1c6a90f | |||
| 6be016636e | |||
| 1926ccba5e | |||
| c1036f927a | |||
| 78a72662e4 | |||
| 87273ce726 | |||
| 292f33e766 | |||
| f2c5111552 | |||
| 8194dde652 | |||
| 021d43e575 | |||
| 180e5529b3 | |||
| a13d77aa3f | |||
| 71d720c56f | |||
| f5fcd75978 | |||
| 6249b44d1e | |||
| 7e215ab98f | |||
| 213b2d3ecb | |||
| d84eb61daf | |||
| 00caf14449 | |||
| b631e6d37a | |||
| f5b22923dc | |||
| 16e8890eb9 | |||
| 3e0303c10e | |||
| 8ebe1f10bb | |||
| 1aa6918ac2 | |||
| ca03fd282c | |||
| e139ec12a7 | |||
| 3decdb3a89 | |||
| 6cfa2727b6 | |||
| 13350b7c54 | |||
| 47fae1949e | |||
| 6b3e28f047 | |||
| 1ac429e234 | |||
| 5f5a79f896 | |||
| 9bc104d3a7 | |||
| d7fed6f1d8 | |||
| fc3f894509 | |||
| f9c477ef62 | |||
| a4e086827b | |||
| dd84fe2918 | |||
| b3a1b925c1 | |||
| b76ba3ca04 | |||
| b08cb9eceb | |||
| 04a56fc323 | |||
| d2bf9e5bd1 | |||
| e3f52b8a31 | |||
| 1c96542343 | |||
| 13efbe43d6 | |||
| 68f49e0cab | |||
| 87bbf557c1 | |||
| f2f944fdee | |||
| 80559d5bf3 | |||
| 10b0611451 | |||
| 1ab3a71c82 | |||
| 482a5e7136 | |||
| 76d10120c6 | |||
| f19a75be2c | |||
| cf34ff2e9d | |||
| b6f8fff6e4 | |||
| 0f2220f5e4 | |||
| e458b06ed6 | |||
| 596223b5e0 | |||
| 5c3e3504a9 | |||
| 306693f191 | |||
| e4540bc3b9 | |||
| fe4a600363 | |||
| b6e4f5ef01 | |||
| 6cdce68307 | |||
| 1d780bd461 | |||
| 170244e12e | |||
| 1fba3e7918 | |||
| 06f5ea9f7a | |||
| bc0a160ef7 | |||
| dfe436a30d | |||
| 4d4073a6de | |||
| 8beee5c1f9 | |||
| 00c31200ba | |||
| 3764b0ae16 | |||
| d1f71c7b43 | |||
| 9f2b0f1842 | |||
| f6a66f984c | |||
| 1054a8fb5e | |||
| a08d109b51 | |||
| 09c4d40050 | |||
| eb1000d219 | |||
| e527fba74d | |||
| 2f04d8b04a | |||
| 9921a696ec | |||
| 6b22c435bb | |||
| 2d5864913c | |||
| 32360540f4 | |||
| ec93c0dbda | |||
| b865ee86b4 | |||
| 43612ab097 | |||
| 995cacd6f7 | |||
| ca7b1bfea8 | |||
| 36b99ee689 | |||
| 2819de6d31 | |||
| e7b77ae7bb | |||
| 2aa23363ef | |||
| 33ce46ce39 | |||
| de74e26e73 | |||
| adb04a76c5 | |||
| b78b05540a | |||
| a3fae98d20 | |||
| cc2bc22abf | |||
| c78c2f598c | |||
| df57c8c62c | |||
| 8a43169447 | |||
| 03b6389cc5 | |||
| 3d60a5b2da | |||
| 2cae8881f2 | |||
| 0bd1af949c | |||
| c0d3b93c09 | |||
| 4b4f618262 | |||
| fe2ab5edd2 | |||
| bd48bd2c0d | |||
| 4608256f79 | |||
| 42ddbbde39 | |||
| b2b0280464 | |||
| 2524231ef2 | |||
| db549890ec | |||
| f6d8668837 | |||
| 3cf3644d81 | |||
| 5a9631bb49 | |||
| 3929d5df11 | |||
| 09e329b412 | |||
| 5b76bb51b0 | |||
| 7f05636c59 | |||
| 0170f2ea39 | |||
| 5ffb22d9cc | |||
| fcad3b33b4 | |||
| 9e55f43d73 | |||
| b25e62e5dc | |||
| 9355ab0939 | |||
| 3f0af8b0e6 | |||
| 50bb28c100 | |||
| a2af2cc244 | |||
| 6a75c35b50 | |||
| 4224508d6a | |||
| 4711f8aaef | |||
| 83ce2ae629 | |||
| ad135afba7 | |||
| 7e6116f122 | |||
| 7569b990c2 | |||
| 00e1e066f2 | |||
| 465b3e4044 | |||
| 1c1632bdbc | |||
| d4e67a00f4 | |||
| c857fa57ff | |||
| 872121ee38 | |||
| fbb4a31084 | |||
| 604c1cba54 | |||
| 9136fc99c0 | |||
| 2e4737bb4f | |||
| 2d3f4abbdd | |||
| c6cf66e13e | |||
| f175d07667 | |||
| b5f13fde4e | |||
| 4aa2bf58a7 | |||
| 5f9a205ab2 | |||
| bb714d4282 | |||
| dbb031cd25 | |||
| 1484e9fbb5 | |||
| c60cae6a84 | |||
| b68a1a3196 | |||
| 1b2cbd4164 | |||
| 732c268505 | |||
| 9310ccd140 | |||
| 5c7d644699 | |||
| f3e43d91be | |||
| 1fc9e0ab15 | |||
| e70ca194a0 | |||
| 957ae651b6 | |||
| 381a0784c9 | |||
| 9b0265964e | |||
| 6871b13462 | |||
| 210e5f3fea | |||
| 81afc83e4c | |||
| da224cb0e3 | |||
| 251b1e3dd0 | |||
| fc255c93d7 | |||
| d77d91514c | |||
| bfcd9d1104 | |||
| 1a3be38da5 | |||
| 1fee2ca549 | |||
| 89437cfb51 | |||
| 3321b378c6 | |||
| 573336e001 | |||
| a2fbb171ec | |||
| c916dd1c33 | |||
| 83d33073dd | |||
| 89c76997bb | |||
| 94418b6f11 | |||
| 30f3289e95 | |||
| fa998f493e | |||
| 1aca3126f7 | |||
| 08eab20ec5 | |||
| a55c1ddf9f | |||
| 043e1f39cf | |||
| 21447cea48 | |||
| a9eb385a24 | |||
| 3567187a1a | |||
| afe9acbfe2 | |||
| b264bf31a0 | |||
| be60a166b3 | |||
| 267e541f0c | |||
| 1366aadddc | |||
| 7bd7c693ad | |||
| 1535c6dbdd | |||
| c7157f77b6 | |||
| fcf6fe9e4a | |||
| c4fe677969 | |||
| c2d61f8d44 | |||
| 47408da7af | |||
| 92246eb881 | |||
| 01e02bfa8c | |||
| 48d0880d6a | |||
| 3ab86392bb | |||
| ec14972f38 | |||
| 5866c45986 | |||
| 8dc772b43c | |||
| 7cbbc2e970 | |||
| 313650f8c1 | |||
| baae7ec8fe | |||
| e8636c2729 | |||
| 0c53bc8d62 | |||
| a72345f0e6 | |||
| cfef82f4f9 | |||
| 602a58a5f0 | |||
| 785707cdee | |||
| f9e56fc102 | |||
| bbf566e63c | |||
| a6f2062fd4 | |||
| 8b2e55b3f6 | |||
| b4a9e193c1 | |||
| 377f249fbf | |||
| 64301fcfd1 | |||
| 7117681f97 | |||
| fc1785c354 | |||
| 1000d5ba09 | |||
| 86bccdc06d | |||
| 297bdc2094 | |||
| d2b0b07f73 | |||
| 8ace88a733 | |||
| 45209a37e2 | |||
| 49f4b5af52 | |||
| 1d7507de5c | |||
| 1cd2a28445 | |||
| f960273304 | |||
| adca94abca | |||
| af76947473 | |||
| e5883ea53c | |||
| 2520dca5b1 | |||
| f4ae94070a | |||
| 97e16fd489 | |||
| da2f89048f | |||
| ba82cbc35c | |||
| b8644f1ac5 | |||
| 95c224a6ab | |||
| 97e44c06c7 | |||
| d80d378639 | |||
| 3fb428be72 | |||
| db01d1ad6c | |||
| 52444eb06d | |||
| 1d46172340 | |||
| 793b6851ce | |||
| 437c49a57c | |||
| cd1e489d86 | |||
| ce9b300704 | |||
| 5eb840a978 | |||
| 97bddef64d | |||
| 606f67579a | |||
| 5adb2b9c0a | |||
| 4caaade74b | |||
| 93ae59d16b | |||
| 0fd13a2cbe | |||
| 1f8cd83651 | |||
| bf9c75382f | |||
| 65a6745805 | |||
| 7798287b07 | |||
| b0e200fb96 | |||
| 44673b8dbe | |||
| 2f140bcc11 | |||
| 301e307b7a | |||
| ca247d62fd | |||
| 1dfb4d798e | |||
| d0827e9790 | |||
| 7bc271438c | |||
| 86e5a3b84f | |||
| 0c18b84388 | |||
| 6edd54a0bc | |||
| 8a747694ca | |||
| ec96d463db | |||
| c7e2004124 | |||
| e3c0353c9a | |||
| 8c436bf664 | |||
| 1bdf87b1ce | |||
| 956655c237 | |||
| 9fc15b40aa | |||
| d1796943dc | |||
| cf9937fab0 | |||
| 7a814244e0 | |||
| 911d758ad3 | |||
| 0d7db32097 | |||
| 02b350dc2e | |||
| bd8e651370 | |||
| a62a294a5f | |||
| b0722f128f | |||
| 142e51eb3f | |||
| d0b07f4a1b | |||
| bf9351b403 | |||
| 84b158adec | |||
| f2415bb0c5 | |||
| 8c8cbdfc97 | |||
| 4ef1e5f118 | |||
| 6e12aa7183 | |||
| 888ccc0e94 | |||
| 663168d222 | |||
| 26fbdbbd6b | |||
| 75963109ab | |||
| a270952841 | |||
| 3e521d1e9d | |||
| ae3c41b92d | |||
| c7f4dceacb | |||
| 865baa0848 | |||
| fd250cb031 | |||
| 589309c4c1 | |||
| 21f9162def | |||
| d08791e99a | |||
| 71109045c4 | |||
| db84d2dfa4 | |||
| 28d9b78aec | |||
| 4f94ea5634 | |||
| 4a1c39f7d6 | |||
| 891d628333 | |||
| 6ffe2e8205 | |||
| b21f5336c7 | |||
| 1eb2af3c15 | |||
| 0d8c737c2e | |||
| 3a2ecdabed | |||
| 44306ebc4f | |||
| 78ed8357c6 | |||
| c3fb06f8d8 | |||
| 7606d5054f | |||
| 44ff4b00ca | |||
| 7e21f9901b | |||
| 128ebc8b3a | |||
| 5d6901ee9c | |||
| d40149b7df | |||
| f3f6b8e413 | |||
| 90cad16c4e | |||
| 36a490288a | |||
| eb37b651bf | |||
| d6e8192bc5 | |||
| a8ff358d3a | |||
| c246bb2721 | |||
| 7a63bb28b7 | |||
| 4e54ba1901 | |||
| c23940e5d0 | |||
| abef01f61f | |||
| c269652dc5 | |||
| 8af9f79eec | |||
| cd0fd6f22b | |||
| 105100b7fe | |||
| 636ddd07aa | |||
| 2d50d6a623 | |||
| 98f8e800b8 | |||
| d010b1ec23 | |||
| a73f1271ee | |||
| 13dbbeb6da | |||
| 20c63af417 | |||
| 761d9fe649 | |||
| 30b71c41f1 | |||
| a34958aba9 | |||
| 4f6be95112 | |||
| a6749bc8ac | |||
| b2a51c54cb | |||
| 0cf0728601 | |||
| 5894630373 | |||
| 5459351faa | |||
| b17e5a4390 | |||
| a020c5690d | |||
| 88235dd087 | |||
| ef554e635f | |||
| 445a388d5c | |||
| 324f6a9cc8 | |||
| 9254797ef9 | |||
| 7e9242e671 | |||
| 7bfb40de61 | |||
| 1cfe4cce8d | |||
| 8267002335 | |||
| 0a8510fbb7 | |||
| 602182bad5 | |||
| a8ba05e2db | |||
| 45b2fdd3c5 | |||
| f0c8676b11 | |||
| 0fb0c3e22a | |||
| 61054ae4d7 | |||
| bcc645d400 | |||
| 594da537cc | |||
| d81dd9d4cb | |||
| 51571bd30d | |||
| c463376049 | |||
| 139c25fde5 | |||
| 41c6bdec9a | |||
| e9823849b1 | |||
| 1eba7cb397 | |||
| fb48297b20 | |||
| 63495c34ed | |||
| 9f7e57cf2e | |||
| f4fd893dbd | |||
| b98e5ea907 | |||
| ccbb0c758d | |||
| d9dc3bde7c | |||
| a9722a6e21 | |||
| 874841009c | |||
| e288d53d8c | |||
| d920c659b3 | |||
| c918082b4a | |||
| 0fe4bac47b | |||
| 9ef86b5514 | |||
| 2540a53e5a | |||
| e9507fc04b | |||
| 954c36e731 | |||
| edb2fcb3ca | |||
| b3803b6ef4 | |||
| 7ff700105c | |||
| e12abdd678 | |||
| e4666e0dcb | |||
| 87f9577a0a | |||
| 63b024699c | |||
| 9702259283 | |||
| 324bf731ef | |||
| ec2c67394a | |||
| 568d4dba14 | |||
| 94230cfd8e | |||
| da09346226 | |||
| 6e8a78f6c0 | |||
| bb2bb6f84e | |||
| 465d8f8eec | |||
| 3f05e95170 | |||
| cda54ec6ad | |||
| 276d0b7195 | |||
| a9a9beb65b | |||
| d40ecbc8ee | |||
| f96d54f00d | |||
| 52da0652a3 | |||
| 71470225eb | |||
| 5ab73309f7 | |||
| 200006a80b | |||
| b445596349 | |||
| 67400a8844 | |||
| cf8d57906b | |||
| 98410983b0 | |||
| 0bde636acd | |||
| 140270c647 | |||
| 82f9578f11 | |||
| c73409a8cd | |||
| 98c62e0e66 | |||
| ca163f9be1 | |||
| 6b844009b4 | |||
| 8e2002b52e | |||
| 4df4b627a3 | |||
| 39c5b5dc77 | |||
| 3c38ed8cd4 | |||
| a57b4690ec | |||
| a59ab1c422 | |||
| 1a8e0448ba | |||
| 1bffac7054 | |||
| 2e450837c4 | |||
| 59f1b4d98a | |||
| a63eaa4c64 | |||
| 607554038d | |||
| 3c4d1f5d7d | |||
| 960bde220a | |||
| fb23379a28 | |||
| 5198872fdf | |||
| a137fd7650 | |||
| 583668e525 | |||
| a1effaebe6 | |||
| ff62202016 | |||
| c4a8a42bb4 | |||
| beca7f9385 | |||
| 04a8aab221 | |||
| 46fbdc6853 | |||
| bb80064540 | |||
| 3e8ba9cb4b | |||
| 03bb9e5327 | |||
| 52f92df85d | |||
| f7630261a5 | |||
| 49457b92f9 | |||
| 21a90c1106 | |||
| 53e089cfe2 | |||
| 5c6a1a6667 | |||
| c974682aec | |||
| a467bfebd9 | |||
| d8876a5f65 | |||
| 3965f680f3 | |||
| 2b3885279d | |||
| c040ee4a94 | |||
| 490a019167 | |||
| 0cd99485b3 | |||
| cc812f8fff | |||
| 7f8b8a401d | |||
| 09ef1b14d5 | |||
| ee8afcb1bf | |||
| 9d14c4d9d0 | |||
| 203a15edb0 | |||
| 702a2aa0e0 | |||
| 45f4dda42d | |||
| 151a7aa8a6 | |||
| 428623754c | |||
| b5ab48224d | |||
| c5d5ea7852 | |||
| 82e7a0d3c5 | |||
| e9edc3c104 | |||
| 1377338548 | |||
| 41794c1850 | |||
| 46599ab661 | |||
| 136dcf90b9 | |||
| 5ec4a629b2 | |||
| 0958ea424c | |||
| 87843e9161 | |||
| 8fcc61baea | |||
| 2571108774 | |||
| 01bca0839d | |||
| dd7aa1d195 | |||
| 3c2cc9dcaa | |||
| 89d8b2e477 | |||
| 88f0280372 | |||
| 67abc15707 | |||
| 87e4874fd5 | |||
| 1f3d2a6328 | |||
| 2532386159 | |||
| c74260b61e | |||
| bd344878e6 | |||
| b0b9f1341a | |||
| d481332a7f | |||
| 6c48f6922b | |||
| d79e3cea6a | |||
| 0e2e303099 | |||
| 70c6d48870 | |||
| 1df8554700 | |||
| 8b621b4fa0 | |||
| 565433ea7c | |||
| 7eda8ced34 | |||
| 03fac052a4 | |||
| 7a381217a7 | |||
| 4a39893edd | |||
| 88527b6a49 | |||
| 66387a098e | |||
| 71409d87e9 | |||
| b9553c54e4 | |||
| abfaaca698 | |||
| 76247acbb2 | |||
| 0abbc563a4 | |||
| 75749581f4 | |||
| d7f8277041 | |||
| f9730e8e32 | |||
| 2c1a5a9461 | |||
| fb7a301420 | |||
| 537141008a | |||
| a0fdadbecf | |||
| 42f1742254 | |||
| e94050f5da | |||
| 6fd2e333a7 | |||
| 6ba0474dc5 | |||
| 878021579f | |||
| 4bd10cd5c4 | |||
| 6d7c6b64e1 | |||
| 2f2bb1be2f | |||
| cb057684a9 | |||
| 19a596c414 | |||
| b5572b7855 | |||
| e0b58811eb | |||
| f5f910c25d | |||
| 076c34414f | |||
| 65b0a353cc | |||
| 2020b5bc34 | |||
| 384210a7a1 | |||
| 601155eaba | |||
| 74e342a6e5 | |||
| fec3e479e6 | |||
| 827011c064 | |||
| 8695809c5a | |||
| 39c7b5b53d | |||
| 0aaa92b723 | |||
| cc7a8c3102 | |||
| 6f97b1a1c3 | |||
| 71d2436712 | |||
| 7468a92f44 | |||
| bc9dc3e82b | |||
| 6ee941ecc7 | |||
| 7874cc39cf | |||
| 21998583f4 | |||
| 8000ab89a9 | |||
| a2f9820e73 | |||
| 78b42f021a | |||
| 75179b7331 | |||
| 4cd71bbaf5 | |||
| 4967bfd70a | |||
| a167f0f1ae | |||
| 51f328e21a | |||
| 385771b0c0 | |||
| 8b5a91efaa | |||
| 584d48f0fb | |||
| be76f1eacc | |||
| 6e06022abb | |||
| cf79eee8a4 | |||
| eb8beb2301 | |||
| 18ceb49ce0 | |||
| 76a10ed5e4 | |||
| b015005e3f | |||
| 8eb9575b2b | |||
| dc1dbd5889 | |||
| c15ffaf372 | |||
| 05a2c0fe8b | |||
| 1c332bf192 | |||
| 4921adc2d0 | |||
| e757c06970 | |||
| 9d26ef6408 | |||
| 18a0a0f63e | |||
| 0d4149506f | |||
| f21e1ea8df | |||
| 3f1bb6b131 | |||
| 93865b6504 | |||
| 2a9a6ee42d | |||
| 057bbbb4f7 | |||
| 161670903e | |||
| 3a752dbfa0 | |||
| 10b303ae96 | |||
| 45d6f73da3 | |||
| f6d37827aa | |||
| 195d9c7269 | |||
| cbb63e0b1e | |||
| 54a8e6b175 | |||
| 871b3d2bc0 | |||
| 439affb4ea | |||
| 1470e8fd8d | |||
| 00d5e9e00a | |||
| baf2e2312f | |||
| 458a1b944c | |||
| 6df0661287 | |||
| 0f62bb5581 | |||
| c904891bb7 | |||
| 183e643d49 | |||
| 7266504a8a | |||
| 6ccac47713 | |||
| 322a2451da | |||
| cc76ed82aa | |||
| ab42451b16 | |||
| 8b661422ca | |||
| e61538ba96 | |||
| d20e92e308 | |||
| 95098e27f2 | |||
| 58da41abb9 | |||
| 56ac27318d | |||
| 9945cf63fa | |||
| 832d4d1261 | |||
| 9632fd5dc1 | |||
| 1143f51a44 | |||
| 16bed61a8e | |||
| 7c7491576e | |||
| 455f4f90d0 | |||
| 741da0a190 | |||
| 524fb81ca7 | |||
| 4e7d38005c | |||
| b2d293bfa9 | |||
| 0a2f92954d | |||
| db6fe2404c | |||
| 552a0d3c8f | |||
| 1968eceecd | |||
| 23d757da59 | |||
| 4a527a6485 | |||
| 6da557e7ad | |||
| 05dbf834d1 | |||
| 4b03f708f7 | |||
| a46ffbfff1 | |||
| acc664bcb2 | |||
| 3bb303d23e | |||
| 8342689420 | |||
| 86fec83a66 | |||
| 72515b4ebd | |||
| d8ae3bbff7 | |||
| b3e7bd5fc0 | |||
| 097826718c | |||
| b9e2263ea8 | |||
| 6275ef2131 | |||
| 97cad9b421 | |||
| 686f459284 | |||
| 93e477f5c6 | |||
| cce78b8090 | |||
| 7878873a83 | |||
| fb7fc388d7 | |||
| 9e128f055c | |||
| 1e3acb0e66 | |||
| 78e3496c31 | |||
| fa221d0b75 | |||
| b7229f4f80 | |||
| d344d61a6d | |||
| 831680f812 | |||
| 6b16c03623 | |||
| 7c6d2acc57 | |||
| f19a3c97fe | |||
| 74499a97b3 | |||
| 1092a4a41b | |||
| 26fcd4ab88 | |||
| 3b79ea4178 | |||
| a890945476 | |||
| a405f610d1 | |||
| 9b6855e3b3 | |||
| a25e8fad7c | |||
| 90d86e3acc | |||
| 229b949f83 | |||
| 9b7fbc8766 | |||
| 101bb726d8 | |||
| 853d2bf1ab | |||
| acc9cee2ce | |||
| 17dbcbf6a4 | |||
| 4d1f6586ad | |||
| 20a3e8289a | |||
| 6843719494 | |||
| 56ced276ec | |||
| d10bd849a0 | |||
| 0452bf9461 | |||
| 808688fb52 | |||
| d65d35213f | |||
| d3f5c38588 | |||
| be74a10350 | |||
| 4fd172b4d6 | |||
| acedabd4a9 | |||
| 8d658e4e54 | |||
| 81f6eb258e | |||
| 5cdc516adb | |||
| a3ac402923 | |||
| c60a7a8375 | |||
| 22b82f9ccd | |||
| 045d631b80 | |||
| 60efeeb4fb | |||
| 9740b9a8b2 | |||
| 7bce870c7c | |||
| b27d1a1315 | |||
| f6651c5728 | |||
| f3bbb83000 | |||
| b503c99d41 | |||
| 9e8e1d498c | |||
| 286dc15e40 | |||
| 2350aa6ad6 | |||
| f2b7b2e1af | |||
| 1c0044770b | |||
| f30b1a6914 | |||
| fdc0bef9fc | |||
| aedb215412 | |||
| d830f732b0 | |||
| 74fc6b5ea3 | |||
| 069a13f08a | |||
| e9bf7b7e82 | |||
| 3531f5005e | |||
| 0268feed13 | |||
| 217fc5daf6 | |||
| 4968e77b16 | |||
| a674f3c4e1 | |||
| 40901afeb5 | |||
| 21df6f71f4 | |||
| 3902390859 | |||
| 0840e350bf | |||
| d46be87296 | |||
| db9a7e570a |
@@ -0,0 +1,2 @@
|
||||
lib/** -diff linguist-generated=true
|
||||
dist/** -diff linguist-generated=true
|
||||
@@ -0,0 +1,14 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "05:00"
|
||||
timezone: "Asia/Tokyo"
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "20:00"
|
||||
open-pull-requests-limit: 10
|
||||
@@ -1,16 +0,0 @@
|
||||
name: Comment on Pull Request
|
||||
on:
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: ./
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
header: FromPR
|
||||
message: |
|
||||
Test ${{ github.sha }} is successfully ended.
|
||||
This is message from PR.
|
||||
@@ -1,20 +0,0 @@
|
||||
name: Comment on Push
|
||||
on:
|
||||
- push
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: jwalton/gh-find-current-pr@v1
|
||||
id: finder
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: ./
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ steps.finder.outputs.pr }}
|
||||
message: |
|
||||
Test ${{ github.sha }} is successfully ended.
|
||||
This is message from push.
|
||||
@@ -1,16 +1,48 @@
|
||||
name: Test
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v4
|
||||
- run: yarn install
|
||||
- run: |
|
||||
set -o pipefail
|
||||
mkdir -p ./pr
|
||||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
|
||||
echo "all_result<<$EOF" >> "$GITHUB_ENV"
|
||||
yarn all >> "$GITHUB_ENV" 2>&1 || true # proceed even if yarn fails
|
||||
echo >> "$GITHUB_ENV" # yarn all doesn't necessarily produce a newline
|
||||
echo "$EOF" >> "$GITHUB_ENV"
|
||||
id: all
|
||||
- uses: ./
|
||||
if: ${{ github.event_name == 'pull_request_target' }}
|
||||
with:
|
||||
header: All
|
||||
message: |
|
||||
<details open>
|
||||
<summary>Output of yarn all</summary>
|
||||
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm test
|
||||
```shell
|
||||
${{ env.all_result }}
|
||||
```
|
||||
</details>
|
||||
- uses: ./
|
||||
if: ${{ github.event_name == 'pull_request_target' }}
|
||||
with:
|
||||
header: All
|
||||
append: true
|
||||
hide_details: true
|
||||
message: |
|
||||
The build is over.
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
- name: Format Check
|
||||
run: npm run format-check
|
||||
|
||||
+6
-1
@@ -1,8 +1,11 @@
|
||||
__tests__/runner/*
|
||||
|
||||
lib/*
|
||||
# comment out in distribution branches
|
||||
node_modules/
|
||||
|
||||
package-lock.json
|
||||
|
||||
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||
# Logs
|
||||
logs
|
||||
@@ -92,4 +95,6 @@ typings/
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
.vscode/
|
||||
.vscode/
|
||||
|
||||
.yarn.lock
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
nodejs 12.18.0
|
||||
nodejs 20.11.0
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
# Sticky Pull Request Comment
|
||||
|
||||
Create comment on pull request, if exists update that comment.
|
||||
Create a comment on a pull request, if it exists update that comment.
|
||||
This library runs with GitHub Actions. If you feel that the example grammar below is not friendly enough, we recommend reading [this page](https://docs.github.com/en/actions) first.
|
||||
|
||||
## Usage:
|
||||
## Usage
|
||||
|
||||
### Basic
|
||||
|
||||
You need to add permissions for this tool.
|
||||
|
||||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v1
|
||||
permissions:
|
||||
pull-requests: write
|
||||
```
|
||||
|
||||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
message: |
|
||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||
```
|
||||
@@ -18,59 +25,56 @@ with:
|
||||
|
||||
In some cases, different actions may require different comments. The header allows you to maintain comments independently.
|
||||
|
||||
```yaml
|
||||
````yaml
|
||||
release:
|
||||
...
|
||||
- uses: marocchino/sticky-pull-request-comment@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
header: release
|
||||
message: |
|
||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
header: release
|
||||
message: |
|
||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||
|
||||
test:
|
||||
...
|
||||
- name: Run Test
|
||||
id: test
|
||||
run: |
|
||||
OUTPUT=$(rake test)
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=result::$OUTPUT"
|
||||
- uses: marocchino/sticky-pull-request-comment@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
header: test
|
||||
message: |
|
||||
```
|
||||
${{ steps.test.outputs.result }}
|
||||
```
|
||||
```
|
||||
run: |
|
||||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
|
||||
{
|
||||
echo "TEST_RESULT<<$EOF"
|
||||
rake test
|
||||
echo "$EOF"
|
||||
} >> "$GITHUB_ENV"
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
header: test
|
||||
message: |
|
||||
```
|
||||
${{ env.TEST_RESULT }}
|
||||
```
|
||||
````
|
||||
|
||||
### Append after comment every time it runs
|
||||
|
||||
```yaml
|
||||
````yaml
|
||||
test:
|
||||
...
|
||||
- name: Run Test
|
||||
id: test
|
||||
run: |
|
||||
OUTPUT=$(rake test)
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=result::$OUTPUT"
|
||||
- uses: marocchino/sticky-pull-request-comment@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
append: true
|
||||
message: |
|
||||
Test with ${{ github.sha }}.
|
||||
```
|
||||
${{ steps.test.outputs.result }}
|
||||
```
|
||||
```
|
||||
run: |
|
||||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
|
||||
{
|
||||
echo "TEST_RESULT<<$EOF"
|
||||
rake test
|
||||
echo "$EOF"
|
||||
} >> "$GITHUB_ENV"
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
append: true
|
||||
message: |
|
||||
Test with ${{ github.sha }}.
|
||||
```
|
||||
${{ env.TEST_RESULT }}
|
||||
```
|
||||
````
|
||||
|
||||
### Comment from push
|
||||
|
||||
@@ -78,98 +82,171 @@ If for some reason, triggering on pr is not possible, you can use push.
|
||||
|
||||
```yaml
|
||||
- uses: jwalton/gh-find-current-pr@v1
|
||||
id: finder
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: marocchino/sticky-pull-request-comment@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ steps.finder.outputs.pr }}
|
||||
message: |
|
||||
Test ${{ github.sha }} is successfully ended.
|
||||
This is message from push.
|
||||
id: finder
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
number: ${{ steps.finder.outputs.pr }}
|
||||
message: |
|
||||
Test ${{ github.sha }} ended successfully.
|
||||
This message is from a push.
|
||||
```
|
||||
|
||||
### Read comment from a file
|
||||
|
||||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v1
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
path: path-to-comment-contents.txt
|
||||
```
|
||||
|
||||
### Delete previous commit and add comment at bottom
|
||||
### Delete the previous comment and add a comment at the end
|
||||
|
||||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v1
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
recreate: true
|
||||
message: |
|
||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||
```
|
||||
|
||||
### Delete previous commit
|
||||
### Delete previous comment
|
||||
|
||||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v1
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
header: <same-header-as-the-step-that-added-the-comment>
|
||||
delete: true
|
||||
```
|
||||
|
||||
### Hide the previous comment and add a comment at the end
|
||||
|
||||
## Development
|
||||
|
||||
Install the dependencies
|
||||
|
||||
```bash
|
||||
$ npm install
|
||||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
hide_and_recreate: true
|
||||
hide_classify: "OUTDATED"
|
||||
message: |
|
||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||
```
|
||||
|
||||
Build the typescript
|
||||
### Hide previous comment
|
||||
|
||||
```bash
|
||||
$ npm run build
|
||||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
header: <same-header-as-the-step-that-added-the-comment>
|
||||
hide: true
|
||||
hide_classify: "OUTDATED"
|
||||
```
|
||||
|
||||
Run the tests :heavy_check_mark:
|
||||
### Error: Resource not accessible by integration
|
||||
|
||||
```bash
|
||||
$ npm test
|
||||
This tool requires write permission, and that message means the requester does not have enough permission.
|
||||
Recently, GitHub sets permissions conservatively for newly created repositories. If it's a newly created repository, check your Settings > Actions > General > Workflow permissions, and make sure to enable read and write permissions.
|
||||
|
||||
PASS ./index.test.js
|
||||
✓ throws invalid number (3ms)
|
||||
✓ wait 500 ms (504ms)
|
||||
✓ test runs (95ms)
|
||||
Then, you can specify permissions for the job like this:
|
||||
|
||||
...
|
||||
```yaml
|
||||
permissions:
|
||||
pull-requests: write
|
||||
```
|
||||
|
||||
## Publish to a distribution branch
|
||||
If your repository is private, setting this setting removes all default permissions on your workflow, so for the actions/checkout step to work which is highly common, you will also need the `contents` permissions set.
|
||||
Otherwise you will get an error such as "fatal: repository *** not found"
|
||||
|
||||
Actions are run from GitHub repos. We will create a releases branch and only checkin production modules (core in this case).
|
||||
|
||||
Comment out node_modules in .gitignore and create a releases/v1 branch
|
||||
|
||||
```bash
|
||||
# comment out in distribution branches
|
||||
# node_modules/
|
||||
```yaml
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
```
|
||||
|
||||
```bash
|
||||
$ git checkout -b releases/v1
|
||||
$ git commit -a -m "prod dependencies"
|
||||
```
|
||||
For more detailed information about permissions, you can read from the link below:
|
||||
<https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs>
|
||||
|
||||
```bash
|
||||
$ npm prune --production
|
||||
$ git add node_modules
|
||||
$ git commit -a -m "prod dependencies"
|
||||
$ git push origin releases/v1
|
||||
```
|
||||
## Inputs
|
||||
|
||||
Your action is now published! :rocket:
|
||||
### `header`
|
||||
|
||||
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
|
||||
**Optional** Header to determine if the comment should be updated (it is not shown to users). It can be used when you want to add multiple comments independently to a given object.
|
||||
|
||||
### `append`
|
||||
|
||||
**Optional** Indicate if new comment messages should be appended to previous comment message. Only `true` is allowed. Just skip this option when you don't need it.
|
||||
|
||||
### `recreate`
|
||||
|
||||
**Optional** Indicate if previous comment should be removed before creating a new comment. Only `true` is allowed. Just skip this option when you don't need it.
|
||||
|
||||
### `delete`
|
||||
|
||||
**Optional** Delete a previously created comment. Use `header` to point to which comment you want to delete. Only `true` is allowed (i.e. delete this option if you don't need it).
|
||||
|
||||
### `only_create`
|
||||
|
||||
**Optional** Only create a new comment if there is no existing one, otherwise do nothing. Only `true` is allowed. Just skip this item when you don't need it. This options has higher priority than hide_and_recreate, hide.
|
||||
|
||||
### `only_update`
|
||||
|
||||
**Optional** Only update a exist comment if there is existing one, otherwise do nothing. Only `true` is allowed. Just skip this item when you don't need it.
|
||||
|
||||
### `hide`
|
||||
|
||||
**Optional** Hide a previously created comment. Use `header` to point to which comment you want to delete. Only `true` is allowed (i.e. delete this option if you don't need it).
|
||||
|
||||
### `hide_classify`
|
||||
|
||||
**Optional** The reasons a piece of content can be reported or minimized. SPAM, ABUSE, OFF_TOPIC, OUTDATED, DUPLICATE, RESOLVED are available. default is OUTDATED.
|
||||
|
||||
### `hide_details`
|
||||
|
||||
**Optional** Hide summary tags in the previously created comment. Only `true` is allowed. Just skip this item when you don't need it.
|
||||
|
||||
### `hide_and_recreate`
|
||||
|
||||
**Optional** Indicate if previous comment should be removed before creating a new comment. Only `true` is allowed. Just skip this option when you don't need it.
|
||||
|
||||
### `message`
|
||||
|
||||
**Optional** Comment message
|
||||
|
||||
### `path`
|
||||
|
||||
**Optional** Path to file containing comment message
|
||||
|
||||
### `number`
|
||||
|
||||
**Optional** Pull request number for push event. Note that this has a **lower priority** than the number of a pull_request event.
|
||||
|
||||
### `owner`
|
||||
|
||||
**Optional** Another repository owner, If not set, the current repository owner is used by default. Note that when you trying changing a repo, be aware that `GITHUB_TOKEN` should also have permission for that repository.
|
||||
|
||||
### `repo`
|
||||
|
||||
**Optional** Another repository name. Of limited use on GitHub enterprise. If not set, the current repository is used by default. Note that when you trying changing a repo, be aware that `GITHUB_TOKEN` should also have permission for that repository.
|
||||
|
||||
### `ignore_empty`
|
||||
|
||||
**Optional** By default this is `false`. If set to `true`, no comment will be posted if the comment body is empty. Note that enabling this will prevent comment hiding & deletion from working when the body is empty.
|
||||
|
||||
### `skip_unchanged`
|
||||
|
||||
**Optional** By default this is `false`. If set to `true`, recreating or updating a comment will be skipped if the new message is identical to the current message.
|
||||
|
||||
### `GITHUB_TOKEN`
|
||||
|
||||
**Optional**, You can set [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) here. If not set, this will use `${{ github.token }}`.
|
||||
|
||||
## Outputs
|
||||
|
||||
### `previous_comment_id`
|
||||
|
||||
ID of previous comment, if found
|
||||
|
||||
### `created_comment_id`
|
||||
|
||||
ID of newly created comment, if any
|
||||
|
||||
## Any problem?
|
||||
|
||||
Feel free to report issues. 😃
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
hi there
|
||||
@@ -0,0 +1 @@
|
||||
hey there
|
||||
+248
-98
@@ -1,121 +1,271 @@
|
||||
import {getOctokit} from "@actions/github"
|
||||
import * as core from "@actions/core"
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest'
|
||||
|
||||
import {
|
||||
findPreviousComment,
|
||||
createComment,
|
||||
deleteComment,
|
||||
findPreviousComment,
|
||||
getBodyOf,
|
||||
updateComment,
|
||||
deleteComment
|
||||
} from "../src/comment";
|
||||
const repo = {};
|
||||
minimizeComment,
|
||||
commentsEqual
|
||||
} from "../src/comment"
|
||||
|
||||
vi.mock("@actions/core", () => ({
|
||||
warning: vi.fn()
|
||||
}))
|
||||
|
||||
const repo = {
|
||||
owner: "marocchino",
|
||||
repo: "sticky-pull-request-comment"
|
||||
}
|
||||
it("findPreviousComment", async () => {
|
||||
const authenticatedBotUser = {
|
||||
login: "github-actions[bot]"
|
||||
}
|
||||
const authenticatedUser = {
|
||||
login: "github-actions"
|
||||
}
|
||||
const otherUser = {
|
||||
login: "some-user"
|
||||
}
|
||||
const comment = {
|
||||
user: {
|
||||
login: "github-actions[bot]"
|
||||
},
|
||||
id: "1",
|
||||
author: authenticatedUser,
|
||||
isMinimized: false,
|
||||
body: "previous message\n<!-- Sticky Pull Request Comment -->"
|
||||
};
|
||||
}
|
||||
const commentWithCustomHeader = {
|
||||
user: {
|
||||
login: "github-actions[bot]"
|
||||
},
|
||||
id: "2",
|
||||
author: authenticatedUser,
|
||||
isMinimized: false,
|
||||
body: "previous message\n<!-- Sticky Pull Request CommentTypeA -->"
|
||||
};
|
||||
}
|
||||
const headerFirstComment = {
|
||||
user: {
|
||||
login: "github-actions[bot]"
|
||||
},
|
||||
body: "<!-- Sticky Pull Request CommentLegacyComment -->\nheader first message"
|
||||
id: "3",
|
||||
author: authenticatedUser,
|
||||
isMinimized: false,
|
||||
body: "<!-- Sticky Pull Request CommentLegacyComment -->\nheader first message"
|
||||
}
|
||||
const otherUserComment = {
|
||||
id: "4",
|
||||
author: otherUser,
|
||||
isMinimized: false,
|
||||
body: "Fake previous message\n<!-- Sticky Pull Request Comment -->"
|
||||
}
|
||||
const otherComments = [
|
||||
{
|
||||
user: {
|
||||
login: "some-user"
|
||||
},
|
||||
id: "5",
|
||||
author: otherUser,
|
||||
isMinimized: false,
|
||||
body: "lgtm"
|
||||
},
|
||||
{
|
||||
user: {
|
||||
login: "github-actions[bot]"
|
||||
},
|
||||
id: "6",
|
||||
author: authenticatedUser,
|
||||
isMinimized: false,
|
||||
body: "previous message\n<!-- Sticky Pull Request CommentTypeB -->"
|
||||
},
|
||||
];
|
||||
const octokit = {
|
||||
issues: {
|
||||
listComments: jest.fn(() =>
|
||||
Promise.resolve({
|
||||
data: [commentWithCustomHeader, comment, headerFirstComment, ...otherComments]
|
||||
})
|
||||
)
|
||||
}
|
||||
};
|
||||
]
|
||||
const octokit = getOctokit("github-token")
|
||||
vi.spyOn(octokit, "graphql").mockResolvedValue({
|
||||
viewer: authenticatedBotUser,
|
||||
repository: {
|
||||
pullRequest: {
|
||||
comments: {
|
||||
nodes: [
|
||||
commentWithCustomHeader,
|
||||
otherUserComment,
|
||||
comment,
|
||||
headerFirstComment,
|
||||
...otherComments
|
||||
],
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
endCursor: "6"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} as any)
|
||||
|
||||
expect(await findPreviousComment(octokit, repo, 123, "")).toBe(comment);
|
||||
expect(await findPreviousComment(octokit, repo, 123, "TypeA")).toBe(
|
||||
commentWithCustomHeader
|
||||
);
|
||||
expect(await findPreviousComment(octokit, repo, 123, "")).toBe(comment)
|
||||
expect(await findPreviousComment(octokit, repo, 123, "TypeA")).toBe(commentWithCustomHeader)
|
||||
expect(await findPreviousComment(octokit, repo, 123, "LegacyComment")).toBe(headerFirstComment)
|
||||
expect(octokit.issues.listComments).toBeCalledWith({ issue_number: 123 });
|
||||
});
|
||||
it("updateComment", async () => {
|
||||
const octokit = {
|
||||
issues: {
|
||||
updateComment: jest.fn(() => Promise.resolve())
|
||||
}
|
||||
};
|
||||
expect(
|
||||
await updateComment(octokit, repo, 456, "hello there", "")
|
||||
).toBeUndefined();
|
||||
expect(octokit.issues.updateComment).toBeCalledWith({
|
||||
comment_id: 456,
|
||||
body: "hello there\n<!-- Sticky Pull Request Comment -->"
|
||||
});
|
||||
expect(
|
||||
await updateComment(octokit, repo, 456, "hello there", "TypeA")
|
||||
).toBeUndefined();
|
||||
expect(octokit.issues.updateComment).toBeCalledWith({
|
||||
comment_id: 456,
|
||||
body: "hello there\n<!-- Sticky Pull Request CommentTypeA -->"
|
||||
});
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
after: null,
|
||||
number: 123,
|
||||
owner: "marocchino",
|
||||
repo: "sticky-pull-request-comment"
|
||||
})
|
||||
})
|
||||
|
||||
expect(
|
||||
await updateComment(octokit, repo, 456, "hello there", "TypeA", "hello there\n<!-- Sticky Pull Request CommentTypeA -->")
|
||||
).toBeUndefined();
|
||||
expect(octokit.issues.updateComment).toBeCalledWith({
|
||||
comment_id: 456,
|
||||
body: "hello there\n<!-- Sticky Pull Request CommentTypeA -->\nhello there"
|
||||
});
|
||||
});
|
||||
it("createComment", async () => {
|
||||
const octokit = {
|
||||
issues: {
|
||||
createComment: jest.fn(() => Promise.resolve())
|
||||
}
|
||||
};
|
||||
expect(
|
||||
await createComment(octokit, repo, 456, "hello there", "")
|
||||
).toBeUndefined();
|
||||
expect(octokit.issues.createComment).toBeCalledWith({
|
||||
issue_number: 456,
|
||||
body: "hello there\n<!-- Sticky Pull Request Comment -->"
|
||||
});
|
||||
expect(
|
||||
await createComment(octokit, repo, 456, "hello there", "TypeA")
|
||||
).toBeUndefined();
|
||||
expect(octokit.issues.createComment).toBeCalledWith({
|
||||
issue_number: 456,
|
||||
body: "hello there\n<!-- Sticky Pull Request CommentTypeA -->"
|
||||
});
|
||||
});
|
||||
describe("updateComment", () => {
|
||||
const octokit = getOctokit("github-token")
|
||||
|
||||
beforeEach(() => {
|
||||
vi.spyOn(octokit, "graphql").mockResolvedValue("")
|
||||
})
|
||||
|
||||
it("with comment body", async () => {
|
||||
expect(await updateComment(octokit, "456", "hello there", "")).toBeUndefined()
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
input: {
|
||||
id: "456",
|
||||
body: "hello there\n<!-- Sticky Pull Request Comment -->"
|
||||
}
|
||||
})
|
||||
expect(await updateComment(octokit, "456", "hello there", "TypeA")).toBeUndefined()
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
input: {
|
||||
id: "456",
|
||||
body: "hello there\n<!-- Sticky Pull Request CommentTypeA -->"
|
||||
}
|
||||
})
|
||||
expect(
|
||||
await updateComment(
|
||||
octokit,
|
||||
"456",
|
||||
"hello there",
|
||||
"TypeA",
|
||||
"hello there\n<!-- Sticky Pull Request CommentTypeA -->"
|
||||
)
|
||||
).toBeUndefined()
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
input: {
|
||||
id: "456",
|
||||
body: "hello there\nhello there\n<!-- Sticky Pull Request CommentTypeA -->"
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it("without comment body and previous body", async () => {
|
||||
expect(await updateComment(octokit, "456", "", "")).toBeUndefined()
|
||||
expect(octokit.graphql).not.toBeCalled()
|
||||
expect(core.warning).toBeCalledWith("Comment body cannot be blank")
|
||||
})
|
||||
})
|
||||
|
||||
describe("createComment", () => {
|
||||
const octokit = getOctokit("github-token")
|
||||
|
||||
beforeEach(() => {
|
||||
vi.spyOn(octokit.rest.issues, "createComment")
|
||||
.mockResolvedValue({ data: "<return value>" } as any)
|
||||
})
|
||||
|
||||
it("with comment body or previousBody", async () => {
|
||||
expect(await createComment(octokit, repo, 456, "hello there", "")).toEqual({ data: "<return value>" })
|
||||
expect(octokit.rest.issues.createComment).toBeCalledWith({
|
||||
issue_number: 456,
|
||||
owner: "marocchino",
|
||||
repo: "sticky-pull-request-comment",
|
||||
body: "hello there\n<!-- Sticky Pull Request Comment -->"
|
||||
})
|
||||
expect(await createComment(octokit, repo, 456, "hello there", "TypeA")).toEqual(
|
||||
{ data: "<return value>" }
|
||||
)
|
||||
expect(octokit.rest.issues.createComment).toBeCalledWith({
|
||||
issue_number: 456,
|
||||
owner: "marocchino",
|
||||
repo: "sticky-pull-request-comment",
|
||||
body: "hello there\n<!-- Sticky Pull Request CommentTypeA -->"
|
||||
})
|
||||
})
|
||||
it("without comment body and previousBody", async () => {
|
||||
expect(await createComment(octokit, repo, 456, "", "")).toBeUndefined()
|
||||
expect(octokit.rest.issues.createComment).not.toBeCalled()
|
||||
expect(core.warning).toBeCalledWith("Comment body cannot be blank")
|
||||
})
|
||||
})
|
||||
|
||||
it("deleteComment", async () => {
|
||||
const octokit = {
|
||||
issues: {
|
||||
deleteComment: jest.fn(() => Promise.resolve())
|
||||
const octokit = getOctokit("github-token")
|
||||
|
||||
vi.spyOn(octokit, "graphql").mockReturnValue(undefined as any)
|
||||
expect(await deleteComment(octokit, "456")).toBeUndefined()
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
id: "456"
|
||||
})
|
||||
})
|
||||
|
||||
it("minimizeComment", async () => {
|
||||
const octokit = getOctokit("github-token")
|
||||
|
||||
vi.spyOn(octokit, "graphql").mockReturnValue(undefined as any)
|
||||
expect(await minimizeComment(octokit, "456", "OUTDATED")).toBeUndefined()
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
input: {
|
||||
subjectId: "456",
|
||||
classifier: "OUTDATED"
|
||||
}
|
||||
};
|
||||
expect(
|
||||
await deleteComment(octokit, repo, 456)
|
||||
).toBeUndefined();
|
||||
expect(octokit.issues.deleteComment).toBeCalledWith({
|
||||
comment_id: 456
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
describe("getBodyOf", () => {
|
||||
const nullPrevious = {}
|
||||
const simplePrevious = {
|
||||
body: "hello there\n<!-- Sticky Pull Request CommentTypeA -->"
|
||||
}
|
||||
const detailsPrevious = {
|
||||
body: `
|
||||
<details open>
|
||||
<summary>title</summary>
|
||||
|
||||
content
|
||||
</details>
|
||||
<!-- Sticky Pull Request CommentTypeA -->
|
||||
`
|
||||
}
|
||||
const replaced = `
|
||||
<details>
|
||||
<summary>title</summary>
|
||||
|
||||
content
|
||||
</details>
|
||||
<!-- Sticky Pull Request CommentTypeA -->
|
||||
`
|
||||
it.each`
|
||||
append | hideDetails | previous | expected
|
||||
${false} | ${false} | ${detailsPrevious} | ${undefined}
|
||||
${true} | ${false} | ${nullPrevious} | ${undefined}
|
||||
${true} | ${false} | ${detailsPrevious} | ${detailsPrevious.body}
|
||||
${true} | ${true} | ${nullPrevious} | ${undefined}
|
||||
${true} | ${true} | ${simplePrevious} | ${simplePrevious.body}
|
||||
${true} | ${true} | ${detailsPrevious} | ${replaced}
|
||||
`(
|
||||
"receive $previous, $append, $hideDetails and returns $expected",
|
||||
({append, hideDetails, previous, expected}) => {
|
||||
expect(getBodyOf(previous, append, hideDetails)).toEqual(expected)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
describe("commentsEqual", () => {
|
||||
it.each([
|
||||
{
|
||||
body: "body",
|
||||
previous: "body\n<!-- Sticky Pull Request Commentheader -->",
|
||||
header: "header",
|
||||
expected: true
|
||||
},
|
||||
{
|
||||
body: "body",
|
||||
previous: "body\n<!-- Sticky Pull Request Comment -->",
|
||||
header: "",
|
||||
expected: true
|
||||
},
|
||||
{
|
||||
body: "body",
|
||||
previous: "body\n<!-- Sticky Pull Request Commenta different header -->",
|
||||
header: "header",
|
||||
expected: false
|
||||
},
|
||||
{body: "body", previous: "body", header: "header", expected: false},
|
||||
{body: "body", previous: "", header: "header", expected: false},
|
||||
{body: "", previous: "body", header: "header", expected: false}
|
||||
])("commentsEqual(%s, %s, %s)", ({body, previous, header, expected}) => {
|
||||
expect(commentsEqual(body, previous, header)).toEqual(expected)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -0,0 +1,430 @@
|
||||
import { beforeEach, afterEach, test, expect, vi, describe } from 'vitest'
|
||||
|
||||
const mockConfig = {
|
||||
pullRequestNumber: 123,
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false,
|
||||
getBody: vi.fn().mockResolvedValue("")
|
||||
}
|
||||
|
||||
vi.mock('../src/config', () => {
|
||||
return mockConfig
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
// Set up default environment variables for each test
|
||||
process.env["GITHUB_REPOSITORY"] = "marocchino/stick-pull-request-comment"
|
||||
process.env["INPUT_NUMBER"] = "123"
|
||||
process.env["INPUT_APPEND"] = "false"
|
||||
process.env["INPUT_RECREATE"] = "false"
|
||||
process.env["INPUT_DELETE"] = "false"
|
||||
process.env["INPUT_ONLY_CREATE"] = "false"
|
||||
process.env["INPUT_ONLY_UPDATE"] = "false"
|
||||
process.env["INPUT_HIDE"] = "false"
|
||||
process.env["INPUT_HIDE_AND_RECREATE"] = "false"
|
||||
process.env["INPUT_HIDE_CLASSIFY"] = "OUTDATED"
|
||||
process.env["INPUT_HIDE_DETAILS"] = "false"
|
||||
process.env["INPUT_GITHUB_TOKEN"] = "some-token"
|
||||
process.env["INPUT_IGNORE_EMPTY"] = "false"
|
||||
process.env["INPUT_SKIP_UNCHANGED"] = "false"
|
||||
process.env["INPUT_FOLLOW_SYMBOLIC_LINKS"] = "false"
|
||||
|
||||
// 모킹된 값 초기화
|
||||
mockConfig.pullRequestNumber = 123
|
||||
mockConfig.repo = {owner: "marocchino", repo: "stick-pull-request-comment"}
|
||||
mockConfig.header = ""
|
||||
mockConfig.append = false
|
||||
mockConfig.recreate = false
|
||||
mockConfig.deleteOldComment = false
|
||||
mockConfig.hideOldComment = false
|
||||
mockConfig.hideAndRecreate = false
|
||||
mockConfig.hideClassify = "OUTDATED"
|
||||
mockConfig.hideDetails = false
|
||||
mockConfig.githubToken = "some-token"
|
||||
mockConfig.ignoreEmpty = false
|
||||
mockConfig.skipUnchanged = false
|
||||
mockConfig.getBody.mockResolvedValue("")
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.resetModules()
|
||||
delete process.env["GITHUB_REPOSITORY"]
|
||||
delete process.env["INPUT_OWNER"]
|
||||
delete process.env["INPUT_REPO"]
|
||||
delete process.env["INPUT_HEADER"]
|
||||
delete process.env["INPUT_MESSAGE"]
|
||||
delete process.env["INPUT_NUMBER"]
|
||||
delete process.env["INPUT_APPEND"]
|
||||
delete process.env["INPUT_RECREATE"]
|
||||
delete process.env["INPUT_DELETE"]
|
||||
delete process.env["INPUT_ONLY_CREATE"]
|
||||
delete process.env["INPUT_ONLY_UPDATE"]
|
||||
delete process.env["INPUT_HIDE"]
|
||||
delete process.env["INPUT_HIDE_AND_RECREATE"]
|
||||
delete process.env["INPUT_HIDE_CLASSIFY"]
|
||||
delete process.env["INPUT_HIDE_DETAILS"]
|
||||
delete process.env["INPUT_GITHUB_TOKEN"]
|
||||
delete process.env["INPUT_PATH"]
|
||||
delete process.env["INPUT_IGNORE_EMPTY"]
|
||||
delete process.env["INPUT_SKIP_UNCHANGED"]
|
||||
delete process.env["INPUT_FOLLOW_SYMBOLIC_LINKS"]
|
||||
})
|
||||
|
||||
test("repo", async () => {
|
||||
process.env["INPUT_OWNER"] = "jin"
|
||||
process.env["INPUT_REPO"] = "other"
|
||||
|
||||
mockConfig.repo = {owner: "jin", repo: "other"}
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "jin", repo: "other"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("header", async () => {
|
||||
process.env["INPUT_HEADER"] = "header"
|
||||
mockConfig.header = "header"
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "header",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("append", async () => {
|
||||
process.env["INPUT_APPEND"] = "true"
|
||||
mockConfig.append = true
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: true,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("recreate", async () => {
|
||||
process.env["INPUT_RECREATE"] = "true"
|
||||
mockConfig.recreate = true
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: true,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("delete", async () => {
|
||||
process.env["INPUT_DELETE"] = "true"
|
||||
mockConfig.deleteOldComment = true
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: true,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("hideOldComment", async () => {
|
||||
process.env["INPUT_HIDE"] = "true"
|
||||
mockConfig.hideOldComment = true
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: true,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("hideAndRecreate", async () => {
|
||||
process.env["INPUT_HIDE_AND_RECREATE"] = "true"
|
||||
mockConfig.hideAndRecreate = true
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: true,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("hideClassify", async () => {
|
||||
process.env["INPUT_HIDE_CLASSIFY"] = "OFF_TOPIC"
|
||||
mockConfig.hideClassify = "OFF_TOPIC"
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OFF_TOPIC",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("hideDetails", async () => {
|
||||
process.env["INPUT_HIDE_DETAILS"] = "true"
|
||||
mockConfig.hideDetails = true
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: true,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
describe("path", () => {
|
||||
test("when exists return content of a file", async () => {
|
||||
process.env["INPUT_PATH"] = "./__tests__/assets/result"
|
||||
mockConfig.getBody.mockResolvedValue("hi there\n")
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("hi there\n")
|
||||
})
|
||||
|
||||
test("glob match files", async () => {
|
||||
process.env["INPUT_PATH"] = "./__tests__/assets/*"
|
||||
mockConfig.getBody.mockResolvedValue("hi there\n\nhey there\n")
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("hi there\n\nhey there\n")
|
||||
})
|
||||
|
||||
test("when not exists return null string", async () => {
|
||||
process.env["INPUT_PATH"] = "./__tests__/assets/not_exists"
|
||||
mockConfig.getBody.mockResolvedValue("")
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
})
|
||||
|
||||
test("message", async () => {
|
||||
process.env["INPUT_MESSAGE"] = "hello there"
|
||||
mockConfig.getBody.mockResolvedValue("hello there")
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("hello there")
|
||||
})
|
||||
|
||||
test("ignore_empty", async () => {
|
||||
process.env["INPUT_IGNORE_EMPTY"] = "true"
|
||||
mockConfig.ignoreEmpty = true
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: true,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
|
||||
test("skip_unchanged", async () => {
|
||||
process.env["INPUT_SKIP_UNCHANGED"] = "true"
|
||||
mockConfig.skipUnchanged = true
|
||||
|
||||
const config = await import('../src/config')
|
||||
expect(config).toMatchObject({
|
||||
pullRequestNumber: expect.any(Number),
|
||||
repo: {owner: "marocchino", repo: "stick-pull-request-comment"},
|
||||
header: "",
|
||||
append: false,
|
||||
recreate: false,
|
||||
deleteOldComment: false,
|
||||
hideOldComment: false,
|
||||
hideAndRecreate: false,
|
||||
hideClassify: "OUTDATED",
|
||||
hideDetails: false,
|
||||
githubToken: "some-token",
|
||||
ignoreEmpty: false,
|
||||
skipUnchanged: true
|
||||
})
|
||||
expect(await config.getBody()).toEqual("")
|
||||
})
|
||||
+71
-10
@@ -1,31 +1,92 @@
|
||||
name: "Sticky Pull Request Comment"
|
||||
description: "Create comment on pull request, if exists update that comment."
|
||||
author: "marocchino"
|
||||
github-token:
|
||||
action-input:
|
||||
input: GITHUB_TOKEN
|
||||
is-default: true
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
pull-requests-reason: to create or update PR comment
|
||||
|
||||
inputs:
|
||||
header:
|
||||
description: "Header to determine if the comment is to be updated, not shown on screen"
|
||||
description: "Header to determine if the comment is to be updated, not shown on screen. It can be used when you want to add multiple comments independently at the same time."
|
||||
default: ""
|
||||
required: false
|
||||
append:
|
||||
description: "Indicate if new comment messages should be appended to previous comment message"
|
||||
description: "Indicate if new comment messages should be appended to previous comment message. Only `true` is allowed. Just skip this item when you don't need it."
|
||||
default: "false"
|
||||
required: false
|
||||
recreate:
|
||||
description: "Indicate if previous comment should be removed before creating a new comment"
|
||||
description: "Indicate if previous comment should be removed before creating a new comment. Only `true` is allowed. Just skip this item when you don't need it."
|
||||
default: "false"
|
||||
required: false
|
||||
delete:
|
||||
description: "delete the previously created comment. Only `true` is allowed. Just skip this item when you don't need it."
|
||||
default: "false"
|
||||
required: false
|
||||
only_create:
|
||||
description: "only create a new comment if there is no existing one, otherwise do nothing. Only `true` is allowed. Just skip this item when you don't need it. This options has higher priority than hide_and_recreate, hide."
|
||||
default: "false"
|
||||
required: false
|
||||
only_update:
|
||||
description: "only update a exist comment if there is existing one, otherwise do nothing. Only `true` is allowed. Just skip this item when you don't need it."
|
||||
default: "false"
|
||||
required: false
|
||||
hide_details:
|
||||
description: "hide summary tags in the previously created comment. Only `true` is allowed. Just skip this item when you don't need it."
|
||||
default: "false"
|
||||
required: false
|
||||
hide:
|
||||
description: "hide previously created comment. Only `true` is allowed. Just skip this item when you don't need it."
|
||||
default: "false"
|
||||
required: false
|
||||
hide_and_recreate:
|
||||
description: "Indicate if previous comment should be hide before creating a new comment. Only `true` is allowed. Just skip this item when you don't need it."
|
||||
default: "false"
|
||||
required: false
|
||||
hide_classify:
|
||||
description: "The reasons a piece of content can be reported or minimized. SPAM, ABUSE, OFF_TOPIC, OUTDATED, DUPLICATE, RESOLVED."
|
||||
default: "OUTDATED"
|
||||
required: false
|
||||
message:
|
||||
description: "comment message"
|
||||
required: false
|
||||
path:
|
||||
description: "path to file containing comment message"
|
||||
description: "glob path to file(s) containing comment message"
|
||||
required: false
|
||||
ignore_empty:
|
||||
description: "Indicates whether to ignore missing or empty messages"
|
||||
default: "false"
|
||||
required: false
|
||||
skip_unchanged:
|
||||
description: "only update or recreate if message is different from previous. Only `true` is allowed. Just skip this item when you don't need it."
|
||||
default: "false"
|
||||
required: false
|
||||
follow_symbolic_links:
|
||||
description: "Indicates whether to follow symbolic links for path"
|
||||
default: "false"
|
||||
required: false
|
||||
number:
|
||||
description: "pull request number for push event"
|
||||
required: false
|
||||
delete:
|
||||
description: "delete the previously created comment"
|
||||
owner:
|
||||
description: "Another repo owner, If not set, the current repo owner is used by default. Note that when you trying changing a repo, be aware that GITHUB_TOKEN should also have permission for that repository."
|
||||
required: false
|
||||
repo:
|
||||
description: "Another repo name limited use on github enterprise. If not set, the current repo is used by default. Note that When you trying changing a repo, be aware that GITHUB_TOKEN should also use that repo's."
|
||||
required: false
|
||||
GITHUB_TOKEN:
|
||||
description: "set secrets.GITHUB_TOKEN here"
|
||||
required: true
|
||||
description: "The GitHub access token (e.g. secrets.GITHUB_TOKEN) used to create or update the comment. This defaults to {{ github.token }}."
|
||||
default: "${{ github.token }}"
|
||||
required: false
|
||||
outputs:
|
||||
previous_comment_id:
|
||||
description: "ID of previous comment, if found"
|
||||
created_comment_id:
|
||||
description: "ID of newly created comment, if any"
|
||||
runs:
|
||||
using: "node12"
|
||||
main: "lib/main.js"
|
||||
using: "node20"
|
||||
main: "dist/index.js"
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
|
||||
"files": {
|
||||
"includes": ["src/**/*.ts"]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"formatWithErrors": false,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineEnding": "lf",
|
||||
"lineWidth": 100
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
},
|
||||
"includes": ["vitest.config.ts", "src/**/*.ts", "__tests__/**/*.ts"]
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"jsxQuoteStyle": "double",
|
||||
"quoteProperties": "asNeeded",
|
||||
"semicolons": "asNeeded",
|
||||
"arrowParentheses": "asNeeded",
|
||||
"bracketSameLine": false,
|
||||
"quoteStyle": "double",
|
||||
"bracketSpacing": false
|
||||
},
|
||||
"globals": ["jest"]
|
||||
}
|
||||
}
|
||||
+34728
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+691
@@ -0,0 +1,691 @@
|
||||
@actions/core
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/exec
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/github
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/glob
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/http-client
|
||||
MIT
|
||||
Actions Http Client for Node.js
|
||||
|
||||
Copyright (c) GitHub, Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@actions/io
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@fastify/busboy
|
||||
MIT
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
@octokit/auth-token
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/core
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/endpoint
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/graphql
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/plugin-paginate-rest
|
||||
MIT
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/plugin-rest-endpoint-methods
|
||||
MIT
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/request
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@octokit/request-error
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
balanced-match
|
||||
MIT
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
before-after-hook
|
||||
Apache-2.0
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2018 Gregor Martynus and other contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
brace-expansion
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
concat-map
|
||||
MIT
|
||||
This software is released under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
deprecation
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Gregor Martynus and contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
minimatch
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
once
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
tunnel
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012 Koichi Kobayashi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
undici
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Matteo Collina and Undici contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
universal-user-agent
|
||||
ISC
|
||||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
|
||||
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
wrappy
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -1,11 +0,0 @@
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
verbose: true
|
||||
}
|
||||
Generated
-41
@@ -1,41 +0,0 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.deleteComment = exports.createComment = exports.updateComment = exports.findPreviousComment = void 0;
|
||||
function headerComment(header) {
|
||||
return `<!-- Sticky Pull Request Comment${header} -->`;
|
||||
}
|
||||
function findPreviousComment(octokit, repo, issue_number, header) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { data: comments } = yield octokit.issues.listComments(Object.assign(Object.assign({}, repo), { issue_number }));
|
||||
const h = headerComment(header);
|
||||
return comments.find(comment => comment.body.includes(h));
|
||||
});
|
||||
}
|
||||
exports.findPreviousComment = findPreviousComment;
|
||||
function updateComment(octokit, repo, comment_id, body, header, previousBody) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield octokit.issues.updateComment(Object.assign(Object.assign({}, repo), { comment_id, body: previousBody ? `${previousBody}\n${body}` : `${body}\n${headerComment(header)}` }));
|
||||
});
|
||||
}
|
||||
exports.updateComment = updateComment;
|
||||
function createComment(octokit, repo, issue_number, body, header, previousBody) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield octokit.issues.createComment(Object.assign(Object.assign({}, repo), { issue_number, body: previousBody ? `${previousBody}\n${body}` : `${body}\n${headerComment(header)}` }));
|
||||
});
|
||||
}
|
||||
exports.createComment = createComment;
|
||||
function deleteComment(octokit, repo, comment_id) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield octokit.issues.deleteComment(Object.assign(Object.assign({}, repo), { comment_id }));
|
||||
});
|
||||
}
|
||||
exports.deleteComment = deleteComment;
|
||||
Generated
-90
@@ -1,90 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const github_1 = require("@actions/github");
|
||||
const comment_1 = require("./comment");
|
||||
const fs_1 = require("fs");
|
||||
function run() {
|
||||
var _a, _b;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const number = ((_b = (_a = github_1.context === null || github_1.context === void 0 ? void 0 : github_1.context.payload) === null || _a === void 0 ? void 0 : _a.pull_request) === null || _b === void 0 ? void 0 : _b.number) ||
|
||||
+core.getInput("number", { required: false });
|
||||
if (isNaN(number) || number < 1) {
|
||||
core.info("no numbers given: skip step");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const repo = github_1.context.repo;
|
||||
const message = core.getInput("message", { required: false });
|
||||
const path = core.getInput("path", { required: false });
|
||||
const header = core.getInput("header", { required: false }) || "";
|
||||
const append = core.getInput("append", { required: false }) || false;
|
||||
const recreate = core.getInput("recreate", { required: false }) || false;
|
||||
const deleteOldComment = core.getInput("delete", { required: false }) || false;
|
||||
const githubToken = core.getInput("GITHUB_TOKEN", { required: true });
|
||||
const octokit = new github_1.GitHub(githubToken);
|
||||
const previous = yield comment_1.findPreviousComment(octokit, repo, number, header);
|
||||
if (!message && !path) {
|
||||
throw { message: 'Either message or path input is required' };
|
||||
}
|
||||
if (deleteOldComment && recreate) {
|
||||
throw { message: 'delete and recreate cannot be both set to true' };
|
||||
}
|
||||
let body;
|
||||
if (path) {
|
||||
body = fs_1.readFileSync(path);
|
||||
}
|
||||
else {
|
||||
body = message;
|
||||
}
|
||||
if (previous) {
|
||||
const previousBody = append && previous.body;
|
||||
if (deleteOldComment) {
|
||||
yield comment_1.deleteComment(octokit, repo, previous.id);
|
||||
}
|
||||
else if (recreate) {
|
||||
yield comment_1.deleteComment(octokit, repo, previous.id);
|
||||
yield comment_1.createComment(octokit, repo, number, body, header, previousBody);
|
||||
}
|
||||
else {
|
||||
yield comment_1.updateComment(octokit, repo, previous.id, body, header, previousBody);
|
||||
}
|
||||
}
|
||||
else {
|
||||
yield comment_1.createComment(octokit, repo, number, body, header);
|
||||
}
|
||||
}
|
||||
catch ({ message }) {
|
||||
core.setFailed(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
run();
|
||||
-1
@@ -1 +0,0 @@
|
||||
../which/bin/which
|
||||
-140
@@ -1,140 +0,0 @@
|
||||
# `@actions/core`
|
||||
|
||||
> Core functions for setting results, logging, registering secrets and exporting variables across actions
|
||||
|
||||
## Usage
|
||||
|
||||
### Import the package
|
||||
|
||||
```js
|
||||
// javascript
|
||||
const core = require('@actions/core');
|
||||
|
||||
// typescript
|
||||
import * as core from '@actions/core';
|
||||
```
|
||||
|
||||
#### Inputs/Outputs
|
||||
|
||||
Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
||||
|
||||
```js
|
||||
const myInput = core.getInput('inputName', { required: true });
|
||||
|
||||
core.setOutput('outputKey', 'outputVal');
|
||||
```
|
||||
|
||||
#### Exporting variables
|
||||
|
||||
Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks.
|
||||
|
||||
```js
|
||||
core.exportVariable('envVar', 'Val');
|
||||
```
|
||||
|
||||
#### Setting a secret
|
||||
|
||||
Setting a secret registers the secret with the runner to ensure it is masked in logs.
|
||||
|
||||
```js
|
||||
core.setSecret('myPassword');
|
||||
```
|
||||
|
||||
#### PATH Manipulation
|
||||
|
||||
To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH.
|
||||
|
||||
```js
|
||||
core.addPath('/path/to/mytool');
|
||||
```
|
||||
|
||||
#### Exit codes
|
||||
|
||||
You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success.
|
||||
|
||||
```js
|
||||
const core = require('@actions/core');
|
||||
|
||||
try {
|
||||
// Do stuff
|
||||
}
|
||||
catch (err) {
|
||||
// setFailed logs the message and sets a failing exit code
|
||||
core.setFailed(`Action failed with error ${err}`);
|
||||
}
|
||||
|
||||
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
||||
|
||||
```
|
||||
|
||||
#### Logging
|
||||
|
||||
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
|
||||
|
||||
```js
|
||||
const core = require('@actions/core');
|
||||
|
||||
const myInput = core.getInput('input');
|
||||
try {
|
||||
core.debug('Inside try block');
|
||||
|
||||
if (!myInput) {
|
||||
core.warning('myInput was not set');
|
||||
}
|
||||
|
||||
// Do stuff
|
||||
}
|
||||
catch (err) {
|
||||
core.error(`Error ${err}, action may still succeed though`);
|
||||
}
|
||||
```
|
||||
|
||||
This library can also wrap chunks of output in foldable groups.
|
||||
|
||||
```js
|
||||
const core = require('@actions/core')
|
||||
|
||||
// Manually wrap output
|
||||
core.startGroup('Do some function')
|
||||
doSomeFunction()
|
||||
core.endGroup()
|
||||
|
||||
// Wrap an asynchronous function call
|
||||
const result = await core.group('Do something async', async () => {
|
||||
const response = await doSomeHTTPRequest()
|
||||
return response
|
||||
})
|
||||
```
|
||||
|
||||
#### Action state
|
||||
|
||||
You can use this library to save state and get state for sharing information between a given wrapper action:
|
||||
|
||||
**action.yml**
|
||||
```yaml
|
||||
name: 'Wrapper action sample'
|
||||
inputs:
|
||||
name:
|
||||
default: 'GitHub'
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'main.js'
|
||||
post: 'cleanup.js'
|
||||
```
|
||||
|
||||
In action's `main.js`:
|
||||
|
||||
```js
|
||||
const core = require('@actions/core');
|
||||
|
||||
core.saveState("pidToKill", 12345);
|
||||
```
|
||||
|
||||
In action's `cleanup.js`:
|
||||
```js
|
||||
const core = require('@actions/core');
|
||||
|
||||
var pid = core.getState("pidToKill");
|
||||
|
||||
process.kill(pid);
|
||||
```
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
interface CommandProperties {
|
||||
[key: string]: string;
|
||||
}
|
||||
/**
|
||||
* Commands
|
||||
*
|
||||
* Command Format:
|
||||
* ##[name key=value;key=value]message
|
||||
*
|
||||
* Examples:
|
||||
* ##[warning]This is the user warning message
|
||||
* ##[set-secret name=mypassword]definitelyNotAPassword!
|
||||
*/
|
||||
export declare function issueCommand(command: string, properties: CommandProperties, message: string): void;
|
||||
export declare function issue(name: string, message?: string): void;
|
||||
export {};
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const os = require("os");
|
||||
/**
|
||||
* Commands
|
||||
*
|
||||
* Command Format:
|
||||
* ##[name key=value;key=value]message
|
||||
*
|
||||
* Examples:
|
||||
* ##[warning]This is the user warning message
|
||||
* ##[set-secret name=mypassword]definitelyNotAPassword!
|
||||
*/
|
||||
function issueCommand(command, properties, message) {
|
||||
const cmd = new Command(command, properties, message);
|
||||
process.stdout.write(cmd.toString() + os.EOL);
|
||||
}
|
||||
exports.issueCommand = issueCommand;
|
||||
function issue(name, message = '') {
|
||||
issueCommand(name, {}, message);
|
||||
}
|
||||
exports.issue = issue;
|
||||
const CMD_STRING = '::';
|
||||
class Command {
|
||||
constructor(command, properties, message) {
|
||||
if (!command) {
|
||||
command = 'missing.command';
|
||||
}
|
||||
this.command = command;
|
||||
this.properties = properties;
|
||||
this.message = message;
|
||||
}
|
||||
toString() {
|
||||
let cmdStr = CMD_STRING + this.command;
|
||||
if (this.properties && Object.keys(this.properties).length > 0) {
|
||||
cmdStr += ' ';
|
||||
for (const key in this.properties) {
|
||||
if (this.properties.hasOwnProperty(key)) {
|
||||
const val = this.properties[key];
|
||||
if (val) {
|
||||
// safely append the val - avoid blowing up when attempting to
|
||||
// call .replace() if message is not a string for some reason
|
||||
cmdStr += `${key}=${escape(`${val || ''}`)},`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cmdStr += CMD_STRING;
|
||||
// safely append the message - avoid blowing up when attempting to
|
||||
// call .replace() if message is not a string for some reason
|
||||
const message = `${this.message || ''}`;
|
||||
cmdStr += escapeData(message);
|
||||
return cmdStr;
|
||||
}
|
||||
}
|
||||
function escapeData(s) {
|
||||
return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
|
||||
}
|
||||
function escape(s) {
|
||||
return s
|
||||
.replace(/\r/g, '%0D')
|
||||
.replace(/\n/g, '%0A')
|
||||
.replace(/]/g, '%5D')
|
||||
.replace(/;/g, '%3B');
|
||||
}
|
||||
//# sourceMappingURL=command.js.map
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;AAAA,yBAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,8DAA8D;wBAC9D,6DAA6D;wBAC7D,MAAM,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,CAAC,GAAG,CAAA;qBAC9C;iBACF;aACF;SACF;QAED,MAAM,IAAI,UAAU,CAAA;QAEpB,kEAAkE;QAClE,6DAA6D;QAC7D,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAA;QACvC,MAAM,IAAI,UAAU,CAAC,OAAO,CAAC,CAAA;QAE7B,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
||||
-112
@@ -1,112 +0,0 @@
|
||||
/**
|
||||
* Interface for getInput options
|
||||
*/
|
||||
export interface InputOptions {
|
||||
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
|
||||
required?: boolean;
|
||||
}
|
||||
/**
|
||||
* The code to exit an action
|
||||
*/
|
||||
export declare enum ExitCode {
|
||||
/**
|
||||
* A code indicating that the action was successful
|
||||
*/
|
||||
Success = 0,
|
||||
/**
|
||||
* A code indicating that the action was a failure
|
||||
*/
|
||||
Failure = 1
|
||||
}
|
||||
/**
|
||||
* Sets env variable for this action and future actions in the job
|
||||
* @param name the name of the variable to set
|
||||
* @param val the value of the variable
|
||||
*/
|
||||
export declare function exportVariable(name: string, val: string): void;
|
||||
/**
|
||||
* Registers a secret which will get masked from logs
|
||||
* @param secret value of the secret
|
||||
*/
|
||||
export declare function setSecret(secret: string): void;
|
||||
/**
|
||||
* Prepends inputPath to the PATH (for this action and future actions)
|
||||
* @param inputPath
|
||||
*/
|
||||
export declare function addPath(inputPath: string): void;
|
||||
/**
|
||||
* Gets the value of an input. The value is also trimmed.
|
||||
*
|
||||
* @param name name of the input to get
|
||||
* @param options optional. See InputOptions.
|
||||
* @returns string
|
||||
*/
|
||||
export declare function getInput(name: string, options?: InputOptions): string;
|
||||
/**
|
||||
* Sets the value of an output.
|
||||
*
|
||||
* @param name name of the output to set
|
||||
* @param value value to store
|
||||
*/
|
||||
export declare function setOutput(name: string, value: string): void;
|
||||
/**
|
||||
* Sets the action status to failed.
|
||||
* When the action exits it will be with an exit code of 1
|
||||
* @param message add error issue message
|
||||
*/
|
||||
export declare function setFailed(message: string): void;
|
||||
/**
|
||||
* Writes debug message to user log
|
||||
* @param message debug message
|
||||
*/
|
||||
export declare function debug(message: string): void;
|
||||
/**
|
||||
* Adds an error issue
|
||||
* @param message error issue message
|
||||
*/
|
||||
export declare function error(message: string): void;
|
||||
/**
|
||||
* Adds an warning issue
|
||||
* @param message warning issue message
|
||||
*/
|
||||
export declare function warning(message: string): void;
|
||||
/**
|
||||
* Writes info to log with console.log.
|
||||
* @param message info message
|
||||
*/
|
||||
export declare function info(message: string): void;
|
||||
/**
|
||||
* Begin an output group.
|
||||
*
|
||||
* Output until the next `groupEnd` will be foldable in this group
|
||||
*
|
||||
* @param name The name of the output group
|
||||
*/
|
||||
export declare function startGroup(name: string): void;
|
||||
/**
|
||||
* End an output group.
|
||||
*/
|
||||
export declare function endGroup(): void;
|
||||
/**
|
||||
* Wrap an asynchronous function call in a group.
|
||||
*
|
||||
* Returns the same type as the function itself.
|
||||
*
|
||||
* @param name The name of the group
|
||||
* @param fn The function to wrap in the group
|
||||
*/
|
||||
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
||||
/**
|
||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||
*
|
||||
* @param name name of the state to store
|
||||
* @param value value to store
|
||||
*/
|
||||
export declare function saveState(name: string, value: string): void;
|
||||
/**
|
||||
* Gets the value of an state set by this action's main execution.
|
||||
*
|
||||
* @param name name of the state to get
|
||||
* @returns string
|
||||
*/
|
||||
export declare function getState(name: string): string;
|
||||
-195
@@ -1,195 +0,0 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const command_1 = require("./command");
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
/**
|
||||
* The code to exit an action
|
||||
*/
|
||||
var ExitCode;
|
||||
(function (ExitCode) {
|
||||
/**
|
||||
* A code indicating that the action was successful
|
||||
*/
|
||||
ExitCode[ExitCode["Success"] = 0] = "Success";
|
||||
/**
|
||||
* A code indicating that the action was a failure
|
||||
*/
|
||||
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
||||
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
||||
//-----------------------------------------------------------------------
|
||||
// Variables
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets env variable for this action and future actions in the job
|
||||
* @param name the name of the variable to set
|
||||
* @param val the value of the variable
|
||||
*/
|
||||
function exportVariable(name, val) {
|
||||
process.env[name] = val;
|
||||
command_1.issueCommand('set-env', { name }, val);
|
||||
}
|
||||
exports.exportVariable = exportVariable;
|
||||
/**
|
||||
* Registers a secret which will get masked from logs
|
||||
* @param secret value of the secret
|
||||
*/
|
||||
function setSecret(secret) {
|
||||
command_1.issueCommand('add-mask', {}, secret);
|
||||
}
|
||||
exports.setSecret = setSecret;
|
||||
/**
|
||||
* Prepends inputPath to the PATH (for this action and future actions)
|
||||
* @param inputPath
|
||||
*/
|
||||
function addPath(inputPath) {
|
||||
command_1.issueCommand('add-path', {}, inputPath);
|
||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
||||
}
|
||||
exports.addPath = addPath;
|
||||
/**
|
||||
* Gets the value of an input. The value is also trimmed.
|
||||
*
|
||||
* @param name name of the input to get
|
||||
* @param options optional. See InputOptions.
|
||||
* @returns string
|
||||
*/
|
||||
function getInput(name, options) {
|
||||
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
||||
if (options && options.required && !val) {
|
||||
throw new Error(`Input required and not supplied: ${name}`);
|
||||
}
|
||||
return val.trim();
|
||||
}
|
||||
exports.getInput = getInput;
|
||||
/**
|
||||
* Sets the value of an output.
|
||||
*
|
||||
* @param name name of the output to set
|
||||
* @param value value to store
|
||||
*/
|
||||
function setOutput(name, value) {
|
||||
command_1.issueCommand('set-output', { name }, value);
|
||||
}
|
||||
exports.setOutput = setOutput;
|
||||
//-----------------------------------------------------------------------
|
||||
// Results
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the action status to failed.
|
||||
* When the action exits it will be with an exit code of 1
|
||||
* @param message add error issue message
|
||||
*/
|
||||
function setFailed(message) {
|
||||
process.exitCode = ExitCode.Failure;
|
||||
error(message);
|
||||
}
|
||||
exports.setFailed = setFailed;
|
||||
//-----------------------------------------------------------------------
|
||||
// Logging Commands
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Writes debug message to user log
|
||||
* @param message debug message
|
||||
*/
|
||||
function debug(message) {
|
||||
command_1.issueCommand('debug', {}, message);
|
||||
}
|
||||
exports.debug = debug;
|
||||
/**
|
||||
* Adds an error issue
|
||||
* @param message error issue message
|
||||
*/
|
||||
function error(message) {
|
||||
command_1.issue('error', message);
|
||||
}
|
||||
exports.error = error;
|
||||
/**
|
||||
* Adds an warning issue
|
||||
* @param message warning issue message
|
||||
*/
|
||||
function warning(message) {
|
||||
command_1.issue('warning', message);
|
||||
}
|
||||
exports.warning = warning;
|
||||
/**
|
||||
* Writes info to log with console.log.
|
||||
* @param message info message
|
||||
*/
|
||||
function info(message) {
|
||||
process.stdout.write(message + os.EOL);
|
||||
}
|
||||
exports.info = info;
|
||||
/**
|
||||
* Begin an output group.
|
||||
*
|
||||
* Output until the next `groupEnd` will be foldable in this group
|
||||
*
|
||||
* @param name The name of the output group
|
||||
*/
|
||||
function startGroup(name) {
|
||||
command_1.issue('group', name);
|
||||
}
|
||||
exports.startGroup = startGroup;
|
||||
/**
|
||||
* End an output group.
|
||||
*/
|
||||
function endGroup() {
|
||||
command_1.issue('endgroup');
|
||||
}
|
||||
exports.endGroup = endGroup;
|
||||
/**
|
||||
* Wrap an asynchronous function call in a group.
|
||||
*
|
||||
* Returns the same type as the function itself.
|
||||
*
|
||||
* @param name The name of the group
|
||||
* @param fn The function to wrap in the group
|
||||
*/
|
||||
function group(name, fn) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
startGroup(name);
|
||||
let result;
|
||||
try {
|
||||
result = yield fn();
|
||||
}
|
||||
finally {
|
||||
endGroup();
|
||||
}
|
||||
return result;
|
||||
});
|
||||
}
|
||||
exports.group = group;
|
||||
//-----------------------------------------------------------------------
|
||||
// Wrapper action state
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||
*
|
||||
* @param name name of the state to store
|
||||
* @param value value to store
|
||||
*/
|
||||
function saveState(name, value) {
|
||||
command_1.issueCommand('save-state', { name }, value);
|
||||
}
|
||||
exports.saveState = saveState;
|
||||
/**
|
||||
* Gets the value of an state set by this action's main execution.
|
||||
*
|
||||
* @param name name of the state to get
|
||||
* @returns string
|
||||
*/
|
||||
function getState(name) {
|
||||
return process.env[`STATE_${name}`] || '';
|
||||
}
|
||||
exports.getState = getState;
|
||||
//# sourceMappingURL=core.js.map
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAA6C;AAE7C,yBAAwB;AACxB,6BAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IACnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAHD,8BAGC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,eAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzB,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,eAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
{
|
||||
"_from": "@actions/core@1.2.0",
|
||||
"_id": "@actions/core@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw==",
|
||||
"_location": "/@actions/core",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@actions/core@1.2.0",
|
||||
"name": "@actions/core",
|
||||
"escapedName": "@actions%2fcore",
|
||||
"scope": "@actions",
|
||||
"rawSpec": "1.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz",
|
||||
"_shasum": "aa5f52b26c362c821d41557e599371a42f6c0b3d",
|
||||
"_spec": "@actions/core@1.2.0",
|
||||
"_where": "/Users/shim.taewon/Documents/sticky-pull-request-comment",
|
||||
"bugs": {
|
||||
"url": "https://github.com/actions/toolkit/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Actions core lib",
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.2"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
||||
"keywords": [
|
||||
"github",
|
||||
"actions",
|
||||
"core"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/core.js",
|
||||
"name": "@actions/core",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/actions/toolkit.git",
|
||||
"directory": "packages/core"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||
"tsc": "tsc"
|
||||
},
|
||||
"version": "1.2.0"
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
# `@actions/github`
|
||||
|
||||
> A hydrated Octokit client.
|
||||
|
||||
## Usage
|
||||
|
||||
Returns an Octokit client. See https://octokit.github.io/rest.js for the API.
|
||||
|
||||
```js
|
||||
const github = require('@actions/github');
|
||||
const core = require('@actions/core');
|
||||
|
||||
// This should be a token with access to your repository scoped in as a secret.
|
||||
const myToken = core.getInput('myToken');
|
||||
|
||||
const octokit = new github.GitHub(myToken);
|
||||
|
||||
const { data: pullRequest } = await octokit.pulls.get({
|
||||
owner: 'octokit',
|
||||
repo: 'rest.js',
|
||||
pull_number: 123,
|
||||
mediaType: {
|
||||
format: 'diff'
|
||||
}
|
||||
});
|
||||
|
||||
console.log(pullRequest);
|
||||
```
|
||||
|
||||
You can pass client options (except `auth`, which is handled by the token argument), as specified by [Octokit](https://octokit.github.io/rest.js/), as a second argument to the `GitHub` constructor.
|
||||
|
||||
You can also make GraphQL requests. See https://github.com/octokit/graphql.js for the API.
|
||||
|
||||
```js
|
||||
const result = await octokit.graphql(query, variables);
|
||||
```
|
||||
|
||||
Finally, you can get the context of the current action:
|
||||
|
||||
```js
|
||||
const github = require('@actions/github');
|
||||
|
||||
const context = github.context;
|
||||
|
||||
const newIssue = await octokit.issues.create({
|
||||
...context.repo,
|
||||
title: 'New issue!',
|
||||
body: 'Hello Universe!'
|
||||
});
|
||||
```
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
import { WebhookPayload } from './interfaces';
|
||||
export declare class Context {
|
||||
/**
|
||||
* Webhook payload object that triggered the workflow
|
||||
*/
|
||||
payload: WebhookPayload;
|
||||
eventName: string;
|
||||
sha: string;
|
||||
ref: string;
|
||||
workflow: string;
|
||||
action: string;
|
||||
actor: string;
|
||||
/**
|
||||
* Hydrate the context from the environment
|
||||
*/
|
||||
constructor();
|
||||
readonly issue: {
|
||||
owner: string;
|
||||
repo: string;
|
||||
number: number;
|
||||
};
|
||||
readonly repo: {
|
||||
owner: string;
|
||||
repo: string;
|
||||
};
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_1 = require("fs");
|
||||
const os_1 = require("os");
|
||||
class Context {
|
||||
/**
|
||||
* Hydrate the context from the environment
|
||||
*/
|
||||
constructor() {
|
||||
this.payload = {};
|
||||
if (process.env.GITHUB_EVENT_PATH) {
|
||||
if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
|
||||
this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
|
||||
}
|
||||
else {
|
||||
process.stdout.write(`GITHUB_EVENT_PATH ${process.env.GITHUB_EVENT_PATH} does not exist${os_1.EOL}`);
|
||||
}
|
||||
}
|
||||
this.eventName = process.env.GITHUB_EVENT_NAME;
|
||||
this.sha = process.env.GITHUB_SHA;
|
||||
this.ref = process.env.GITHUB_REF;
|
||||
this.workflow = process.env.GITHUB_WORKFLOW;
|
||||
this.action = process.env.GITHUB_ACTION;
|
||||
this.actor = process.env.GITHUB_ACTOR;
|
||||
}
|
||||
get issue() {
|
||||
const payload = this.payload;
|
||||
return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
|
||||
}
|
||||
get repo() {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
|
||||
return { owner, repo };
|
||||
}
|
||||
if (this.payload.repository) {
|
||||
return {
|
||||
owner: this.payload.repository.owner.login,
|
||||
repo: this.payload.repository.name
|
||||
};
|
||||
}
|
||||
throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
|
||||
}
|
||||
}
|
||||
exports.Context = Context;
|
||||
//# sourceMappingURL=context.js.map
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;AAEA,2BAA2C;AAC3C,2BAAsB;AAEtB,MAAa,OAAO;IAalB;;OAEG;IACH;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,IAAI,eAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CACvB,iBAAY,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAChE,CAAA;aACF;iBAAM;gBACL,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,qBACE,OAAO,CAAC,GAAG,CAAC,iBACd,kBAAkB,QAAG,EAAE,CACxB,CAAA;aACF;SACF;QACD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAA2B,CAAA;QACxD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAyB,CAAA;QACrD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAuB,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAsB,CAAA;IACjD,CAAC;IAED,IAAI,KAAK;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,uCACK,IAAI,CAAC,IAAI,KACZ,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,CAAC,MAAM,IACjE;IACH,CAAC;IAED,IAAI,IAAI;QACN,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC9D,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,CAAA;SACrB;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC3B,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK;gBAC1C,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI;aACnC,CAAA;SACF;QAED,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAA;IACH,CAAC;CACF;AAjED,0BAiEC"}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
import { GraphQlQueryResponse, Variables } from '@octokit/graphql';
|
||||
import Octokit from '@octokit/rest';
|
||||
import * as Context from './context';
|
||||
export declare const context: Context.Context;
|
||||
export declare class GitHub extends Octokit {
|
||||
graphql: (query: string, variables?: Variables) => Promise<GraphQlQueryResponse>;
|
||||
constructor(token: string, opts?: Omit<Octokit.Options, 'auth'>);
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
|
||||
const graphql_1 = require("@octokit/graphql");
|
||||
const rest_1 = __importDefault(require("@octokit/rest"));
|
||||
const Context = __importStar(require("./context"));
|
||||
// We need this in order to extend Octokit
|
||||
rest_1.default.prototype = new rest_1.default();
|
||||
exports.context = new Context.Context();
|
||||
class GitHub extends rest_1.default {
|
||||
constructor(token, opts = {}) {
|
||||
super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
|
||||
this.graphql = graphql_1.defaults({
|
||||
headers: { authorization: `token ${token}` }
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.GitHub = GitHub;
|
||||
//# sourceMappingURL=github.js.map
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"github.js","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gGAAgG;AAChG,8CAA0E;AAC1E,yDAAmC;AACnC,mDAAoC;AAEpC,0CAA0C;AAC1C,cAAO,CAAC,SAAS,GAAG,IAAI,cAAO,EAAE,CAAA;AAEpB,QAAA,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;AAE5C,MAAa,MAAO,SAAQ,cAAO;IAMjC,YAAY,KAAa,EAAE,OAAsC,EAAE;QACjE,KAAK,iCAAK,IAAI,KAAE,IAAI,EAAE,SAAS,KAAK,EAAE,IAAE,CAAA;QACxC,IAAI,CAAC,OAAO,GAAG,kBAAQ,CAAC;YACtB,OAAO,EAAE,EAAC,aAAa,EAAE,SAAS,KAAK,EAAE,EAAC;SAC3C,CAAC,CAAA;IACJ,CAAC;CACF;AAZD,wBAYC"}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
export interface PayloadRepository {
|
||||
[key: string]: any;
|
||||
full_name?: string;
|
||||
name: string;
|
||||
owner: {
|
||||
[key: string]: any;
|
||||
login: string;
|
||||
name?: string;
|
||||
};
|
||||
html_url?: string;
|
||||
}
|
||||
export interface WebhookPayload {
|
||||
[key: string]: any;
|
||||
repository?: PayloadRepository;
|
||||
issue?: {
|
||||
[key: string]: any;
|
||||
number: number;
|
||||
html_url?: string;
|
||||
body?: string;
|
||||
};
|
||||
pull_request?: {
|
||||
[key: string]: any;
|
||||
number: number;
|
||||
html_url?: string;
|
||||
body?: string;
|
||||
};
|
||||
sender?: {
|
||||
[key: string]: any;
|
||||
type: string;
|
||||
};
|
||||
action?: string;
|
||||
installation?: {
|
||||
id: number;
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=interfaces.js.map
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"_from": "@actions/github@1.1.0",
|
||||
"_id": "@actions/github@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-cHf6PyoNMdei13jEdGPhKprIMFmjVVW/dnM5/9QmQDJ1ZTaGVyezUSCUIC/ySNLRvDUpeFwPYMdThSEJldSbUw==",
|
||||
"_location": "/@actions/github",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@actions/github@1.1.0",
|
||||
"name": "@actions/github",
|
||||
"escapedName": "@actions%2fgithub",
|
||||
"scope": "@actions",
|
||||
"rawSpec": "1.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@actions/github/-/github-1.1.0.tgz",
|
||||
"_shasum": "06f34e6b0cf07eb2b3641de3e680dbfae6bcd400",
|
||||
"_spec": "@actions/github@1.1.0",
|
||||
"_where": "/Users/shim.taewon/Documents/sticky-pull-request-comment",
|
||||
"bugs": {
|
||||
"url": "https://github.com/actions/toolkit/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@octokit/graphql": "^2.0.1",
|
||||
"@octokit/rest": "^16.15.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Actions github lib",
|
||||
"devDependencies": {
|
||||
"jest": "^24.7.1"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52",
|
||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/github",
|
||||
"keywords": [
|
||||
"github",
|
||||
"actions"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/github.js",
|
||||
"name": "@actions/github",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/actions/toolkit.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "jest",
|
||||
"tsc": "tsc"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-421
@@ -1,421 +0,0 @@
|
||||
# endpoint.js
|
||||
|
||||
> Turns GitHub REST API endpoints into generic request options
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/endpoint)
|
||||

|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
`@octokit/endpoint` combines [GitHub REST API routes](https://developer.github.com/v3/) with your parameters and turns them into generic request options that can be used in any request library.
|
||||
|
||||
<!-- update table of contents by running `npx markdown-toc README.md -i` -->
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [API](#api)
|
||||
- [endpoint()](#endpointroute-options-or-endpointoptions)
|
||||
- [endpoint.defaults()](#endpointdefaults)
|
||||
- [endpoint.DEFAULTS](#endpointdefaults-1)
|
||||
- [endpoint.merge()](#endpointmergeroute-options-or-endpointmergeoptions)
|
||||
- [endpoint.parse()](#endpointparse)
|
||||
- [Special cases](#special-cases)
|
||||
- [The `data` parameter – set request body directly](#the-data-parameter--set-request-body-directly)
|
||||
- [Set parameters for both the URL/query and the request body](#set-parameters-for-both-the-urlquery-and-the-request-body)
|
||||
- [LICENSE](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/endpoint</code> directly from <a href="https://cdn.pika.dev">cdn.pika.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { endpoint } from "https://cdn.pika.dev/@octokit/endpoint";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/endpoint</code>
|
||||
|
||||
```js
|
||||
const { endpoint } = require("@octokit/endpoint");
|
||||
// or: import { endpoint } from "@octokit/endpoint";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Example for [List organization repositories](https://developer.github.com/v3/repos/#list-organization-repositories)
|
||||
|
||||
```js
|
||||
const requestOptions = endpoint("GET /orgs/:org/repos", {
|
||||
headers: {
|
||||
authorization: "token 0000000000000000000000000000000000000001"
|
||||
},
|
||||
org: "octokit",
|
||||
type: "private"
|
||||
});
|
||||
```
|
||||
|
||||
The resulting `requestOptions` looks as follows
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "GET",
|
||||
"url": "https://api.github.com/orgs/octokit/repos?type=private",
|
||||
"headers": {
|
||||
"accept": "application/vnd.github.v3+json",
|
||||
"authorization": "token 0000000000000000000000000000000000000001",
|
||||
"user-agent": "octokit/endpoint.js v1.2.3"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can pass `requestOptions` to common request libraries
|
||||
|
||||
```js
|
||||
const { url, ...options } = requestOptions;
|
||||
// using with fetch (https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
|
||||
fetch(url, options);
|
||||
// using with request (https://github.com/request/request)
|
||||
request(requestOptions);
|
||||
// using with got (https://github.com/sindresorhus/got)
|
||||
got[options.method](url, options);
|
||||
// using with axios
|
||||
axios(requestOptions);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `endpoint(route, options)` or `endpoint(options)`
|
||||
|
||||
<table>
|
||||
<thead align=left>
|
||||
<tr>
|
||||
<th>
|
||||
name
|
||||
</th>
|
||||
<th>
|
||||
type
|
||||
</th>
|
||||
<th width=100%>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody align=left valign=top>
|
||||
<tr>
|
||||
<th>
|
||||
<code>route</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
If set, it has to be a string consisting of URL and the request method, e.g., <code>GET /orgs/:org</code>. If it’s set to a URL, only the method defaults to <code>GET</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.method</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<strong>Required unless <code>route</code> is set.</strong> Any supported <a href="https://developer.github.com/v3/#http-verbs">http verb</a>. <em>Defaults to <code>GET</code></em>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.url</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<strong>Required unless <code>route</code> is set.</strong> A path or full URL which may contain <code>:variable</code> or <code>{variable}</code> placeholders,
|
||||
e.g., <code>/orgs/:org/repos</code>. The <code>url</code> is parsed using <a href="https://github.com/bramstein/url-template">url-template</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.baseUrl</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<em>Defaults to <code>https://api.github.com</code></em>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.headers</code>
|
||||
</th>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
<td>
|
||||
Custom headers. Passed headers are merged with defaults:<br>
|
||||
<em><code>headers['user-agent']</code> defaults to <code>octokit-endpoint.js/1.2.3</code> (where <code>1.2.3</code> is the released version)</em>.<br>
|
||||
<em><code>headers['accept']</code> defaults to <code>application/vnd.github.v3+json</code></em>.<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.mediaType.format</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
Media type param, such as <code>raw</code>, <code>diff</code>, or <code>text+json</code>. See <a href="https://developer.github.com/v3/media/">Media Types</a>. Setting <code>options.mediaType.format</code> will amend the <code>headers.accept</code> value.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.mediaType.previews</code>
|
||||
</th>
|
||||
<td>
|
||||
Array of Strings
|
||||
</td>
|
||||
<td>
|
||||
Name of previews, such as <code>mercy</code>, <code>symmetra</code>, or <code>scarlet-witch</code>. See <a href="https://developer.github.com/v3/previews/">API Previews</a>. If <code>options.mediaType.previews</code> was set as default, the new previews will be merged into the default ones. Setting <code>options.mediaType.previews</code> will amend the <code>headers.accept</code> value. <code>options.mediaType.previews</code> will be merged with an existing array set using <code>.defaults()</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.data</code>
|
||||
</th>
|
||||
<td>
|
||||
Any
|
||||
</td>
|
||||
<td>
|
||||
Set request body directly instead of setting it to JSON based on additional parameters. See <a href="#data-parameter">"The <code>data</code> parameter"</a> below.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.request</code>
|
||||
</th>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
<td>
|
||||
Pass custom meta information for the request. The <code>request</code> object will be returned as is.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
All other options will be passed depending on the `method` and `url` options.
|
||||
|
||||
1. If the option key has a placeholder in the `url`, it will be used as the replacement. For example, if the passed options are `{url: '/orgs/:org/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos`.
|
||||
2. If the `method` is `GET` or `HEAD`, the option is passed as a query parameter.
|
||||
3. Otherwise, the parameter is passed in the request body as a JSON key.
|
||||
|
||||
**Result**
|
||||
|
||||
`endpoint()` is a synchronous method and returns an object with the following keys:
|
||||
|
||||
<table>
|
||||
<thead align=left>
|
||||
<tr>
|
||||
<th>
|
||||
key
|
||||
</th>
|
||||
<th>
|
||||
type
|
||||
</th>
|
||||
<th width=100%>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody align=left valign=top>
|
||||
<tr>
|
||||
<th><code>method</code></th>
|
||||
<td>String</td>
|
||||
<td>The http method. Always lowercase.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>url</code></th>
|
||||
<td>String</td>
|
||||
<td>The url with placeholders replaced with passed parameters.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>headers</code></th>
|
||||
<td>Object</td>
|
||||
<td>All header names are lowercased.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>body</code></th>
|
||||
<td>Any</td>
|
||||
<td>The request body if one is present. Only for <code>PATCH</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code> requests.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>request</code></th>
|
||||
<td>Object</td>
|
||||
<td>Request meta option, it will be returned as it was passed into <code>endpoint()</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### `endpoint.defaults()`
|
||||
|
||||
Override or set default options. Example:
|
||||
|
||||
```js
|
||||
const request = require("request");
|
||||
const myEndpoint = require("@octokit/endpoint").defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
authorization: `token 0000000000000000000000000000000000000001`
|
||||
},
|
||||
org: "my-project",
|
||||
per_page: 100
|
||||
});
|
||||
|
||||
request(myEndpoint(`GET /orgs/:org/repos`));
|
||||
```
|
||||
|
||||
You can call `.defaults()` again on the returned method, the defaults will cascade.
|
||||
|
||||
```js
|
||||
const myProjectEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3"
|
||||
},
|
||||
org: "my-project"
|
||||
});
|
||||
const myProjectEndpointWithAuth = myProjectEndpoint.defaults({
|
||||
headers: {
|
||||
authorization: `token 0000000000000000000000000000000000000001`
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
`myProjectEndpointWithAuth` now defaults the `baseUrl`, `headers['user-agent']`,
|
||||
`org` and `headers['authorization']` on top of `headers['accept']` that is set
|
||||
by the global default.
|
||||
|
||||
### `endpoint.DEFAULTS`
|
||||
|
||||
The current default options.
|
||||
|
||||
```js
|
||||
endpoint.DEFAULTS.baseUrl; // https://api.github.com
|
||||
const myEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3"
|
||||
});
|
||||
myEndpoint.DEFAULTS.baseUrl; // https://github-enterprise.acme-inc.com/api/v3
|
||||
```
|
||||
|
||||
### `endpoint.merge(route, options)` or `endpoint.merge(options)`
|
||||
|
||||
Get the defaulted endpoint options, but without parsing them into request options:
|
||||
|
||||
```js
|
||||
const myProjectEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3"
|
||||
},
|
||||
org: "my-project"
|
||||
});
|
||||
myProjectEndpoint.merge("GET /orgs/:org/repos", {
|
||||
headers: {
|
||||
authorization: `token 0000000000000000000000000000000000000001`
|
||||
},
|
||||
org: "my-secret-project",
|
||||
type: "private"
|
||||
});
|
||||
|
||||
// {
|
||||
// baseUrl: 'https://github-enterprise.acme-inc.com/api/v3',
|
||||
// method: 'GET',
|
||||
// url: '/orgs/:org/repos',
|
||||
// headers: {
|
||||
// accept: 'application/vnd.github.v3+json',
|
||||
// authorization: `token 0000000000000000000000000000000000000001`,
|
||||
// 'user-agent': 'myApp/1.2.3'
|
||||
// },
|
||||
// org: 'my-secret-project',
|
||||
// type: 'private'
|
||||
// }
|
||||
```
|
||||
|
||||
### `endpoint.parse()`
|
||||
|
||||
Stateless method to turn endpoint options into request options. Calling
|
||||
`endpoint(options)` is the same as calling `endpoint.parse(endpoint.merge(options))`.
|
||||
|
||||
## Special cases
|
||||
|
||||
<a name="data-parameter"></a>
|
||||
|
||||
### The `data` parameter – set request body directly
|
||||
|
||||
Some endpoints such as [Render a Markdown document in raw mode](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode) don’t have parameters that are sent as request body keys, instead, the request body needs to be set directly. In these cases, set the `data` parameter.
|
||||
|
||||
```js
|
||||
const options = endpoint("POST /markdown/raw", {
|
||||
data: "Hello world github/linguist#1 **cool**, and #1!",
|
||||
headers: {
|
||||
accept: "text/html;charset=utf-8",
|
||||
"content-type": "text/plain"
|
||||
}
|
||||
});
|
||||
|
||||
// options is
|
||||
// {
|
||||
// method: 'post',
|
||||
// url: 'https://api.github.com/markdown/raw',
|
||||
// headers: {
|
||||
// accept: 'text/html;charset=utf-8',
|
||||
// 'content-type': 'text/plain',
|
||||
// 'user-agent': userAgent
|
||||
// },
|
||||
// body: 'Hello world github/linguist#1 **cool**, and #1!'
|
||||
// }
|
||||
```
|
||||
|
||||
### Set parameters for both the URL/query and the request body
|
||||
|
||||
There are API endpoints that accept both query parameters as well as a body. In that case, you need to add the query parameters as templates to `options.url`, as defined in the [RFC 6570 URI Template specification](https://tools.ietf.org/html/rfc6570).
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
endpoint(
|
||||
"POST https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
|
||||
{
|
||||
name: "example.zip",
|
||||
label: "short description",
|
||||
headers: {
|
||||
"content-type": "text/plain",
|
||||
"content-length": 14,
|
||||
authorization: `token 0000000000000000000000000000000000000001`
|
||||
},
|
||||
data: "Hello, world!"
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
-379
@@ -1,379 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var isPlainObject = _interopDefault(require('is-plain-object'));
|
||||
var universalUserAgent = require('universal-user-agent');
|
||||
|
||||
function lowercaseKeys(object) {
|
||||
if (!object) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return Object.keys(object).reduce((newObj, key) => {
|
||||
newObj[key.toLowerCase()] = object[key];
|
||||
return newObj;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function mergeDeep(defaults, options) {
|
||||
const result = Object.assign({}, defaults);
|
||||
Object.keys(options).forEach(key => {
|
||||
if (isPlainObject(options[key])) {
|
||||
if (!(key in defaults)) Object.assign(result, {
|
||||
[key]: options[key]
|
||||
});else result[key] = mergeDeep(defaults[key], options[key]);
|
||||
} else {
|
||||
Object.assign(result, {
|
||||
[key]: options[key]
|
||||
});
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function merge(defaults, route, options) {
|
||||
if (typeof route === "string") {
|
||||
let [method, url] = route.split(" ");
|
||||
options = Object.assign(url ? {
|
||||
method,
|
||||
url
|
||||
} : {
|
||||
url: method
|
||||
}, options);
|
||||
} else {
|
||||
options = Object.assign({}, route);
|
||||
} // lowercase header names before merging with defaults to avoid duplicates
|
||||
|
||||
|
||||
options.headers = lowercaseKeys(options.headers);
|
||||
const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
|
||||
|
||||
if (defaults && defaults.mediaType.previews.length) {
|
||||
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
|
||||
}
|
||||
|
||||
mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
|
||||
return mergedOptions;
|
||||
}
|
||||
|
||||
function addQueryParameters(url, parameters) {
|
||||
const separator = /\?/.test(url) ? "&" : "?";
|
||||
const names = Object.keys(parameters);
|
||||
|
||||
if (names.length === 0) {
|
||||
return url;
|
||||
}
|
||||
|
||||
return url + separator + names.map(name => {
|
||||
if (name === "q") {
|
||||
return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
|
||||
}
|
||||
|
||||
return `${name}=${encodeURIComponent(parameters[name])}`;
|
||||
}).join("&");
|
||||
}
|
||||
|
||||
const urlVariableRegex = /\{[^}]+\}/g;
|
||||
|
||||
function removeNonChars(variableName) {
|
||||
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
|
||||
}
|
||||
|
||||
function extractUrlVariableNames(url) {
|
||||
const matches = url.match(urlVariableRegex);
|
||||
|
||||
if (!matches) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
||||
}
|
||||
|
||||
function omit(object, keysToOmit) {
|
||||
return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
|
||||
obj[key] = object[key];
|
||||
return obj;
|
||||
}, {});
|
||||
}
|
||||
|
||||
// Based on https://github.com/bramstein/url-template, licensed under BSD
|
||||
// TODO: create separate package.
|
||||
//
|
||||
// Copyright (c) 2012-2014, Bram Stein
|
||||
// All rights reserved.
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
// 3. The name of the author may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/* istanbul ignore file */
|
||||
function encodeReserved(str) {
|
||||
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
|
||||
if (!/%[0-9A-Fa-f]/.test(part)) {
|
||||
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
||||
}
|
||||
|
||||
return part;
|
||||
}).join("");
|
||||
}
|
||||
|
||||
function encodeUnreserved(str) {
|
||||
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
||||
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
function encodeValue(operator, value, key) {
|
||||
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
|
||||
|
||||
if (key) {
|
||||
return encodeUnreserved(key) + "=" + value;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
function isDefined(value) {
|
||||
return value !== undefined && value !== null;
|
||||
}
|
||||
|
||||
function isKeyOperator(operator) {
|
||||
return operator === ";" || operator === "&" || operator === "?";
|
||||
}
|
||||
|
||||
function getValues(context, operator, key, modifier) {
|
||||
var value = context[key],
|
||||
result = [];
|
||||
|
||||
if (isDefined(value) && value !== "") {
|
||||
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
||||
value = value.toString();
|
||||
|
||||
if (modifier && modifier !== "*") {
|
||||
value = value.substring(0, parseInt(modifier, 10));
|
||||
}
|
||||
|
||||
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||
} else {
|
||||
if (modifier === "*") {
|
||||
if (Array.isArray(value)) {
|
||||
value.filter(isDefined).forEach(function (value) {
|
||||
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||
});
|
||||
} else {
|
||||
Object.keys(value).forEach(function (k) {
|
||||
if (isDefined(value[k])) {
|
||||
result.push(encodeValue(operator, value[k], k));
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const tmp = [];
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
value.filter(isDefined).forEach(function (value) {
|
||||
tmp.push(encodeValue(operator, value));
|
||||
});
|
||||
} else {
|
||||
Object.keys(value).forEach(function (k) {
|
||||
if (isDefined(value[k])) {
|
||||
tmp.push(encodeUnreserved(k));
|
||||
tmp.push(encodeValue(operator, value[k].toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (isKeyOperator(operator)) {
|
||||
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
||||
} else if (tmp.length !== 0) {
|
||||
result.push(tmp.join(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (operator === ";") {
|
||||
if (isDefined(value)) {
|
||||
result.push(encodeUnreserved(key));
|
||||
}
|
||||
} else if (value === "" && (operator === "&" || operator === "?")) {
|
||||
result.push(encodeUnreserved(key) + "=");
|
||||
} else if (value === "") {
|
||||
result.push("");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function parseUrl(template) {
|
||||
return {
|
||||
expand: expand.bind(null, template)
|
||||
};
|
||||
}
|
||||
|
||||
function expand(template, context) {
|
||||
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
||||
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
|
||||
if (expression) {
|
||||
let operator = "";
|
||||
const values = [];
|
||||
|
||||
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
||||
operator = expression.charAt(0);
|
||||
expression = expression.substr(1);
|
||||
}
|
||||
|
||||
expression.split(/,/g).forEach(function (variable) {
|
||||
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
||||
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
||||
});
|
||||
|
||||
if (operator && operator !== "+") {
|
||||
var separator = ",";
|
||||
|
||||
if (operator === "?") {
|
||||
separator = "&";
|
||||
} else if (operator !== "#") {
|
||||
separator = operator;
|
||||
}
|
||||
|
||||
return (values.length !== 0 ? operator : "") + values.join(separator);
|
||||
} else {
|
||||
return values.join(",");
|
||||
}
|
||||
} else {
|
||||
return encodeReserved(literal);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function parse(options) {
|
||||
// https://fetch.spec.whatwg.org/#methods
|
||||
let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
|
||||
|
||||
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
|
||||
let headers = Object.assign({}, options.headers);
|
||||
let body;
|
||||
let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
|
||||
|
||||
const urlVariableNames = extractUrlVariableNames(url);
|
||||
url = parseUrl(url).expand(parameters);
|
||||
|
||||
if (!/^http/.test(url)) {
|
||||
url = options.baseUrl + url;
|
||||
}
|
||||
|
||||
const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
|
||||
const remainingParameters = omit(parameters, omittedParameters);
|
||||
const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
|
||||
|
||||
if (!isBinaryRequset) {
|
||||
if (options.mediaType.format) {
|
||||
// e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
|
||||
headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
|
||||
}
|
||||
|
||||
if (options.mediaType.previews.length) {
|
||||
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
|
||||
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
|
||||
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
|
||||
return `application/vnd.github.${preview}-preview${format}`;
|
||||
}).join(",");
|
||||
}
|
||||
} // for GET/HEAD requests, set URL query parameters from remaining parameters
|
||||
// for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
|
||||
|
||||
|
||||
if (["GET", "HEAD"].includes(method)) {
|
||||
url = addQueryParameters(url, remainingParameters);
|
||||
} else {
|
||||
if ("data" in remainingParameters) {
|
||||
body = remainingParameters.data;
|
||||
} else {
|
||||
if (Object.keys(remainingParameters).length) {
|
||||
body = remainingParameters;
|
||||
} else {
|
||||
headers["content-length"] = 0;
|
||||
}
|
||||
}
|
||||
} // default content-type for JSON if body is set
|
||||
|
||||
|
||||
if (!headers["content-type"] && typeof body !== "undefined") {
|
||||
headers["content-type"] = "application/json; charset=utf-8";
|
||||
} // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
|
||||
// fetch does not allow to set `content-length` header, but we can set body to an empty string
|
||||
|
||||
|
||||
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
||||
body = "";
|
||||
} // Only return body/request keys if present
|
||||
|
||||
|
||||
return Object.assign({
|
||||
method,
|
||||
url,
|
||||
headers
|
||||
}, typeof body !== "undefined" ? {
|
||||
body
|
||||
} : null, options.request ? {
|
||||
request: options.request
|
||||
} : null);
|
||||
}
|
||||
|
||||
function endpointWithDefaults(defaults, route, options) {
|
||||
return parse(merge(defaults, route, options));
|
||||
}
|
||||
|
||||
function withDefaults(oldDefaults, newDefaults) {
|
||||
const DEFAULTS = merge(oldDefaults, newDefaults);
|
||||
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
|
||||
return Object.assign(endpoint, {
|
||||
DEFAULTS,
|
||||
defaults: withDefaults.bind(null, DEFAULTS),
|
||||
merge: merge.bind(null, DEFAULTS),
|
||||
parse
|
||||
});
|
||||
}
|
||||
|
||||
const VERSION = "5.5.1";
|
||||
|
||||
const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
|
||||
// So we use RequestParameters and add method as additional required property.
|
||||
|
||||
const DEFAULTS = {
|
||||
method: "GET",
|
||||
baseUrl: "https://api.github.com",
|
||||
headers: {
|
||||
accept: "application/vnd.github.v3+json",
|
||||
"user-agent": userAgent
|
||||
},
|
||||
mediaType: {
|
||||
format: "",
|
||||
previews: []
|
||||
}
|
||||
};
|
||||
|
||||
const endpoint = withDefaults(null, DEFAULTS);
|
||||
|
||||
exports.endpoint = endpoint;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-1
File diff suppressed because one or more lines are too long
-17
@@ -1,17 +0,0 @@
|
||||
import { getUserAgent } from "universal-user-agent";
|
||||
import { VERSION } from "./version";
|
||||
const userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
|
||||
// DEFAULTS has all properties set that EndpointOptions has, except url.
|
||||
// So we use RequestParameters and add method as additional required property.
|
||||
export const DEFAULTS = {
|
||||
method: "GET",
|
||||
baseUrl: "https://api.github.com",
|
||||
headers: {
|
||||
accept: "application/vnd.github.v3+json",
|
||||
"user-agent": userAgent
|
||||
},
|
||||
mediaType: {
|
||||
format: "",
|
||||
previews: []
|
||||
}
|
||||
};
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
import { merge } from "./merge";
|
||||
import { parse } from "./parse";
|
||||
export function endpointWithDefaults(defaults, route, options) {
|
||||
return parse(merge(defaults, route, options));
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
import { withDefaults } from "./with-defaults";
|
||||
import { DEFAULTS } from "./defaults";
|
||||
export const endpoint = withDefaults(null, DEFAULTS);
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
import { lowercaseKeys } from "./util/lowercase-keys";
|
||||
import { mergeDeep } from "./util/merge-deep";
|
||||
export function merge(defaults, route, options) {
|
||||
if (typeof route === "string") {
|
||||
let [method, url] = route.split(" ");
|
||||
options = Object.assign(url ? { method, url } : { url: method }, options);
|
||||
}
|
||||
else {
|
||||
options = Object.assign({}, route);
|
||||
}
|
||||
// lowercase header names before merging with defaults to avoid duplicates
|
||||
options.headers = lowercaseKeys(options.headers);
|
||||
const mergedOptions = mergeDeep(defaults || {}, options);
|
||||
// mediaType.previews arrays are merged, instead of overwritten
|
||||
if (defaults && defaults.mediaType.previews.length) {
|
||||
mergedOptions.mediaType.previews = defaults.mediaType.previews
|
||||
.filter(preview => !mergedOptions.mediaType.previews.includes(preview))
|
||||
.concat(mergedOptions.mediaType.previews);
|
||||
}
|
||||
mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map((preview) => preview.replace(/-preview/, ""));
|
||||
return mergedOptions;
|
||||
}
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
import { addQueryParameters } from "./util/add-query-parameters";
|
||||
import { extractUrlVariableNames } from "./util/extract-url-variable-names";
|
||||
import { omit } from "./util/omit";
|
||||
import { parseUrl } from "./util/url-template";
|
||||
export function parse(options) {
|
||||
// https://fetch.spec.whatwg.org/#methods
|
||||
let method = options.method.toUpperCase();
|
||||
// replace :varname with {varname} to make it RFC 6570 compatible
|
||||
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
|
||||
let headers = Object.assign({}, options.headers);
|
||||
let body;
|
||||
let parameters = omit(options, [
|
||||
"method",
|
||||
"baseUrl",
|
||||
"url",
|
||||
"headers",
|
||||
"request",
|
||||
"mediaType"
|
||||
]);
|
||||
// extract variable names from URL to calculate remaining variables later
|
||||
const urlVariableNames = extractUrlVariableNames(url);
|
||||
url = parseUrl(url).expand(parameters);
|
||||
if (!/^http/.test(url)) {
|
||||
url = options.baseUrl + url;
|
||||
}
|
||||
const omittedParameters = Object.keys(options)
|
||||
.filter(option => urlVariableNames.includes(option))
|
||||
.concat("baseUrl");
|
||||
const remainingParameters = omit(parameters, omittedParameters);
|
||||
const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
|
||||
if (!isBinaryRequset) {
|
||||
if (options.mediaType.format) {
|
||||
// e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
|
||||
headers.accept = headers.accept
|
||||
.split(/,/)
|
||||
.map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`))
|
||||
.join(",");
|
||||
}
|
||||
if (options.mediaType.previews.length) {
|
||||
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
|
||||
headers.accept = previewsFromAcceptHeader
|
||||
.concat(options.mediaType.previews)
|
||||
.map(preview => {
|
||||
const format = options.mediaType.format
|
||||
? `.${options.mediaType.format}`
|
||||
: "+json";
|
||||
return `application/vnd.github.${preview}-preview${format}`;
|
||||
})
|
||||
.join(",");
|
||||
}
|
||||
}
|
||||
// for GET/HEAD requests, set URL query parameters from remaining parameters
|
||||
// for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
|
||||
if (["GET", "HEAD"].includes(method)) {
|
||||
url = addQueryParameters(url, remainingParameters);
|
||||
}
|
||||
else {
|
||||
if ("data" in remainingParameters) {
|
||||
body = remainingParameters.data;
|
||||
}
|
||||
else {
|
||||
if (Object.keys(remainingParameters).length) {
|
||||
body = remainingParameters;
|
||||
}
|
||||
else {
|
||||
headers["content-length"] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// default content-type for JSON if body is set
|
||||
if (!headers["content-type"] && typeof body !== "undefined") {
|
||||
headers["content-type"] = "application/json; charset=utf-8";
|
||||
}
|
||||
// GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
|
||||
// fetch does not allow to set `content-length` header, but we can set body to an empty string
|
||||
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
||||
body = "";
|
||||
}
|
||||
// Only return body/request keys if present
|
||||
return Object.assign({ method, url, headers }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null);
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
export function addQueryParameters(url, parameters) {
|
||||
const separator = /\?/.test(url) ? "&" : "?";
|
||||
const names = Object.keys(parameters);
|
||||
if (names.length === 0) {
|
||||
return url;
|
||||
}
|
||||
return (url +
|
||||
separator +
|
||||
names
|
||||
.map(name => {
|
||||
if (name === "q") {
|
||||
return ("q=" +
|
||||
parameters
|
||||
.q.split("+")
|
||||
.map(encodeURIComponent)
|
||||
.join("+"));
|
||||
}
|
||||
return `${name}=${encodeURIComponent(parameters[name])}`;
|
||||
})
|
||||
.join("&"));
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
const urlVariableRegex = /\{[^}]+\}/g;
|
||||
function removeNonChars(variableName) {
|
||||
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
|
||||
}
|
||||
export function extractUrlVariableNames(url) {
|
||||
const matches = url.match(urlVariableRegex);
|
||||
if (!matches) {
|
||||
return [];
|
||||
}
|
||||
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
export function lowercaseKeys(object) {
|
||||
if (!object) {
|
||||
return {};
|
||||
}
|
||||
return Object.keys(object).reduce((newObj, key) => {
|
||||
newObj[key.toLowerCase()] = object[key];
|
||||
return newObj;
|
||||
}, {});
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
import isPlainObject from "is-plain-object";
|
||||
export function mergeDeep(defaults, options) {
|
||||
const result = Object.assign({}, defaults);
|
||||
Object.keys(options).forEach(key => {
|
||||
if (isPlainObject(options[key])) {
|
||||
if (!(key in defaults))
|
||||
Object.assign(result, { [key]: options[key] });
|
||||
else
|
||||
result[key] = mergeDeep(defaults[key], options[key]);
|
||||
}
|
||||
else {
|
||||
Object.assign(result, { [key]: options[key] });
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
export function omit(object, keysToOmit) {
|
||||
return Object.keys(object)
|
||||
.filter(option => !keysToOmit.includes(option))
|
||||
.reduce((obj, key) => {
|
||||
obj[key] = object[key];
|
||||
return obj;
|
||||
}, {});
|
||||
}
|
||||
-170
@@ -1,170 +0,0 @@
|
||||
// Based on https://github.com/bramstein/url-template, licensed under BSD
|
||||
// TODO: create separate package.
|
||||
//
|
||||
// Copyright (c) 2012-2014, Bram Stein
|
||||
// All rights reserved.
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
// 3. The name of the author may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/* istanbul ignore file */
|
||||
function encodeReserved(str) {
|
||||
return str
|
||||
.split(/(%[0-9A-Fa-f]{2})/g)
|
||||
.map(function (part) {
|
||||
if (!/%[0-9A-Fa-f]/.test(part)) {
|
||||
part = encodeURI(part)
|
||||
.replace(/%5B/g, "[")
|
||||
.replace(/%5D/g, "]");
|
||||
}
|
||||
return part;
|
||||
})
|
||||
.join("");
|
||||
}
|
||||
function encodeUnreserved(str) {
|
||||
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
||||
return ("%" +
|
||||
c
|
||||
.charCodeAt(0)
|
||||
.toString(16)
|
||||
.toUpperCase());
|
||||
});
|
||||
}
|
||||
function encodeValue(operator, value, key) {
|
||||
value =
|
||||
operator === "+" || operator === "#"
|
||||
? encodeReserved(value)
|
||||
: encodeUnreserved(value);
|
||||
if (key) {
|
||||
return encodeUnreserved(key) + "=" + value;
|
||||
}
|
||||
else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
function isDefined(value) {
|
||||
return value !== undefined && value !== null;
|
||||
}
|
||||
function isKeyOperator(operator) {
|
||||
return operator === ";" || operator === "&" || operator === "?";
|
||||
}
|
||||
function getValues(context, operator, key, modifier) {
|
||||
var value = context[key], result = [];
|
||||
if (isDefined(value) && value !== "") {
|
||||
if (typeof value === "string" ||
|
||||
typeof value === "number" ||
|
||||
typeof value === "boolean") {
|
||||
value = value.toString();
|
||||
if (modifier && modifier !== "*") {
|
||||
value = value.substring(0, parseInt(modifier, 10));
|
||||
}
|
||||
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||
}
|
||||
else {
|
||||
if (modifier === "*") {
|
||||
if (Array.isArray(value)) {
|
||||
value.filter(isDefined).forEach(function (value) {
|
||||
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||
});
|
||||
}
|
||||
else {
|
||||
Object.keys(value).forEach(function (k) {
|
||||
if (isDefined(value[k])) {
|
||||
result.push(encodeValue(operator, value[k], k));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
const tmp = [];
|
||||
if (Array.isArray(value)) {
|
||||
value.filter(isDefined).forEach(function (value) {
|
||||
tmp.push(encodeValue(operator, value));
|
||||
});
|
||||
}
|
||||
else {
|
||||
Object.keys(value).forEach(function (k) {
|
||||
if (isDefined(value[k])) {
|
||||
tmp.push(encodeUnreserved(k));
|
||||
tmp.push(encodeValue(operator, value[k].toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
if (isKeyOperator(operator)) {
|
||||
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
||||
}
|
||||
else if (tmp.length !== 0) {
|
||||
result.push(tmp.join(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (operator === ";") {
|
||||
if (isDefined(value)) {
|
||||
result.push(encodeUnreserved(key));
|
||||
}
|
||||
}
|
||||
else if (value === "" && (operator === "&" || operator === "?")) {
|
||||
result.push(encodeUnreserved(key) + "=");
|
||||
}
|
||||
else if (value === "") {
|
||||
result.push("");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function parseUrl(template) {
|
||||
return {
|
||||
expand: expand.bind(null, template)
|
||||
};
|
||||
}
|
||||
function expand(template, context) {
|
||||
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
||||
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
|
||||
if (expression) {
|
||||
let operator = "";
|
||||
const values = [];
|
||||
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
||||
operator = expression.charAt(0);
|
||||
expression = expression.substr(1);
|
||||
}
|
||||
expression.split(/,/g).forEach(function (variable) {
|
||||
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
||||
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
||||
});
|
||||
if (operator && operator !== "+") {
|
||||
var separator = ",";
|
||||
if (operator === "?") {
|
||||
separator = "&";
|
||||
}
|
||||
else if (operator !== "#") {
|
||||
separator = operator;
|
||||
}
|
||||
return (values.length !== 0 ? operator : "") + values.join(separator);
|
||||
}
|
||||
else {
|
||||
return values.join(",");
|
||||
}
|
||||
}
|
||||
else {
|
||||
return encodeReserved(literal);
|
||||
}
|
||||
});
|
||||
}
|
||||
-1
@@ -1 +0,0 @@
|
||||
export const VERSION = "5.5.1";
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import { endpointWithDefaults } from "./endpoint-with-defaults";
|
||||
import { merge } from "./merge";
|
||||
import { parse } from "./parse";
|
||||
export function withDefaults(oldDefaults, newDefaults) {
|
||||
const DEFAULTS = merge(oldDefaults, newDefaults);
|
||||
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
|
||||
return Object.assign(endpoint, {
|
||||
DEFAULTS,
|
||||
defaults: withDefaults.bind(null, DEFAULTS),
|
||||
merge: merge.bind(null, DEFAULTS),
|
||||
parse
|
||||
});
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import { EndpointDefaults } from "@octokit/types";
|
||||
export declare const DEFAULTS: EndpointDefaults;
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
import { EndpointOptions, RequestParameters, Route } from "@octokit/types";
|
||||
import { DEFAULTS } from "./defaults";
|
||||
export declare function endpointWithDefaults(defaults: typeof DEFAULTS, route: Route | EndpointOptions, options?: RequestParameters): import("@octokit/types").RequestOptions;
|
||||
-1
@@ -1 +0,0 @@
|
||||
export declare const endpoint: import("@octokit/types").EndpointInterface;
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import { EndpointDefaults, RequestParameters, Route } from "@octokit/types";
|
||||
export declare function merge(defaults: EndpointDefaults | null, route?: Route | RequestParameters, options?: RequestParameters): EndpointDefaults;
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import { EndpointDefaults, RequestOptions } from "@octokit/types";
|
||||
export declare function parse(options: EndpointDefaults): RequestOptions;
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
export declare function addQueryParameters(url: string, parameters: {
|
||||
[x: string]: string | undefined;
|
||||
q?: string;
|
||||
}): string;
|
||||
-1
@@ -1 +0,0 @@
|
||||
export declare function extractUrlVariableNames(url: string): string[];
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
export declare function lowercaseKeys(object?: {
|
||||
[key: string]: any;
|
||||
}): {
|
||||
[key: string]: any;
|
||||
};
|
||||
-1
@@ -1 +0,0 @@
|
||||
export declare function mergeDeep(defaults: any, options: any): object;
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
export declare function omit(object: {
|
||||
[key: string]: any;
|
||||
}, keysToOmit: string[]): {
|
||||
[key: string]: any;
|
||||
};
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
export declare function parseUrl(template: string): {
|
||||
expand: (context: object) => string;
|
||||
};
|
||||
-1
@@ -1 +0,0 @@
|
||||
export declare const VERSION = "5.5.1";
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import { EndpointInterface, RequestParameters, EndpointDefaults } from "@octokit/types";
|
||||
export declare function withDefaults(oldDefaults: EndpointDefaults | null, newDefaults: RequestParameters): EndpointInterface;
|
||||
-379
@@ -1,379 +0,0 @@
|
||||
import isPlainObject from 'is-plain-object';
|
||||
import { getUserAgent } from 'universal-user-agent';
|
||||
|
||||
function lowercaseKeys(object) {
|
||||
if (!object) {
|
||||
return {};
|
||||
}
|
||||
return Object.keys(object).reduce((newObj, key) => {
|
||||
newObj[key.toLowerCase()] = object[key];
|
||||
return newObj;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function mergeDeep(defaults, options) {
|
||||
const result = Object.assign({}, defaults);
|
||||
Object.keys(options).forEach(key => {
|
||||
if (isPlainObject(options[key])) {
|
||||
if (!(key in defaults))
|
||||
Object.assign(result, { [key]: options[key] });
|
||||
else
|
||||
result[key] = mergeDeep(defaults[key], options[key]);
|
||||
}
|
||||
else {
|
||||
Object.assign(result, { [key]: options[key] });
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function merge(defaults, route, options) {
|
||||
if (typeof route === "string") {
|
||||
let [method, url] = route.split(" ");
|
||||
options = Object.assign(url ? { method, url } : { url: method }, options);
|
||||
}
|
||||
else {
|
||||
options = Object.assign({}, route);
|
||||
}
|
||||
// lowercase header names before merging with defaults to avoid duplicates
|
||||
options.headers = lowercaseKeys(options.headers);
|
||||
const mergedOptions = mergeDeep(defaults || {}, options);
|
||||
// mediaType.previews arrays are merged, instead of overwritten
|
||||
if (defaults && defaults.mediaType.previews.length) {
|
||||
mergedOptions.mediaType.previews = defaults.mediaType.previews
|
||||
.filter(preview => !mergedOptions.mediaType.previews.includes(preview))
|
||||
.concat(mergedOptions.mediaType.previews);
|
||||
}
|
||||
mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map((preview) => preview.replace(/-preview/, ""));
|
||||
return mergedOptions;
|
||||
}
|
||||
|
||||
function addQueryParameters(url, parameters) {
|
||||
const separator = /\?/.test(url) ? "&" : "?";
|
||||
const names = Object.keys(parameters);
|
||||
if (names.length === 0) {
|
||||
return url;
|
||||
}
|
||||
return (url +
|
||||
separator +
|
||||
names
|
||||
.map(name => {
|
||||
if (name === "q") {
|
||||
return ("q=" +
|
||||
parameters
|
||||
.q.split("+")
|
||||
.map(encodeURIComponent)
|
||||
.join("+"));
|
||||
}
|
||||
return `${name}=${encodeURIComponent(parameters[name])}`;
|
||||
})
|
||||
.join("&"));
|
||||
}
|
||||
|
||||
const urlVariableRegex = /\{[^}]+\}/g;
|
||||
function removeNonChars(variableName) {
|
||||
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
|
||||
}
|
||||
function extractUrlVariableNames(url) {
|
||||
const matches = url.match(urlVariableRegex);
|
||||
if (!matches) {
|
||||
return [];
|
||||
}
|
||||
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
||||
}
|
||||
|
||||
function omit(object, keysToOmit) {
|
||||
return Object.keys(object)
|
||||
.filter(option => !keysToOmit.includes(option))
|
||||
.reduce((obj, key) => {
|
||||
obj[key] = object[key];
|
||||
return obj;
|
||||
}, {});
|
||||
}
|
||||
|
||||
// Based on https://github.com/bramstein/url-template, licensed under BSD
|
||||
// TODO: create separate package.
|
||||
//
|
||||
// Copyright (c) 2012-2014, Bram Stein
|
||||
// All rights reserved.
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
// 3. The name of the author may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/* istanbul ignore file */
|
||||
function encodeReserved(str) {
|
||||
return str
|
||||
.split(/(%[0-9A-Fa-f]{2})/g)
|
||||
.map(function (part) {
|
||||
if (!/%[0-9A-Fa-f]/.test(part)) {
|
||||
part = encodeURI(part)
|
||||
.replace(/%5B/g, "[")
|
||||
.replace(/%5D/g, "]");
|
||||
}
|
||||
return part;
|
||||
})
|
||||
.join("");
|
||||
}
|
||||
function encodeUnreserved(str) {
|
||||
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
||||
return ("%" +
|
||||
c
|
||||
.charCodeAt(0)
|
||||
.toString(16)
|
||||
.toUpperCase());
|
||||
});
|
||||
}
|
||||
function encodeValue(operator, value, key) {
|
||||
value =
|
||||
operator === "+" || operator === "#"
|
||||
? encodeReserved(value)
|
||||
: encodeUnreserved(value);
|
||||
if (key) {
|
||||
return encodeUnreserved(key) + "=" + value;
|
||||
}
|
||||
else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
function isDefined(value) {
|
||||
return value !== undefined && value !== null;
|
||||
}
|
||||
function isKeyOperator(operator) {
|
||||
return operator === ";" || operator === "&" || operator === "?";
|
||||
}
|
||||
function getValues(context, operator, key, modifier) {
|
||||
var value = context[key], result = [];
|
||||
if (isDefined(value) && value !== "") {
|
||||
if (typeof value === "string" ||
|
||||
typeof value === "number" ||
|
||||
typeof value === "boolean") {
|
||||
value = value.toString();
|
||||
if (modifier && modifier !== "*") {
|
||||
value = value.substring(0, parseInt(modifier, 10));
|
||||
}
|
||||
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||
}
|
||||
else {
|
||||
if (modifier === "*") {
|
||||
if (Array.isArray(value)) {
|
||||
value.filter(isDefined).forEach(function (value) {
|
||||
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
||||
});
|
||||
}
|
||||
else {
|
||||
Object.keys(value).forEach(function (k) {
|
||||
if (isDefined(value[k])) {
|
||||
result.push(encodeValue(operator, value[k], k));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
const tmp = [];
|
||||
if (Array.isArray(value)) {
|
||||
value.filter(isDefined).forEach(function (value) {
|
||||
tmp.push(encodeValue(operator, value));
|
||||
});
|
||||
}
|
||||
else {
|
||||
Object.keys(value).forEach(function (k) {
|
||||
if (isDefined(value[k])) {
|
||||
tmp.push(encodeUnreserved(k));
|
||||
tmp.push(encodeValue(operator, value[k].toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
if (isKeyOperator(operator)) {
|
||||
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
||||
}
|
||||
else if (tmp.length !== 0) {
|
||||
result.push(tmp.join(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (operator === ";") {
|
||||
if (isDefined(value)) {
|
||||
result.push(encodeUnreserved(key));
|
||||
}
|
||||
}
|
||||
else if (value === "" && (operator === "&" || operator === "?")) {
|
||||
result.push(encodeUnreserved(key) + "=");
|
||||
}
|
||||
else if (value === "") {
|
||||
result.push("");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function parseUrl(template) {
|
||||
return {
|
||||
expand: expand.bind(null, template)
|
||||
};
|
||||
}
|
||||
function expand(template, context) {
|
||||
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
||||
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
|
||||
if (expression) {
|
||||
let operator = "";
|
||||
const values = [];
|
||||
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
||||
operator = expression.charAt(0);
|
||||
expression = expression.substr(1);
|
||||
}
|
||||
expression.split(/,/g).forEach(function (variable) {
|
||||
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
||||
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
||||
});
|
||||
if (operator && operator !== "+") {
|
||||
var separator = ",";
|
||||
if (operator === "?") {
|
||||
separator = "&";
|
||||
}
|
||||
else if (operator !== "#") {
|
||||
separator = operator;
|
||||
}
|
||||
return (values.length !== 0 ? operator : "") + values.join(separator);
|
||||
}
|
||||
else {
|
||||
return values.join(",");
|
||||
}
|
||||
}
|
||||
else {
|
||||
return encodeReserved(literal);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function parse(options) {
|
||||
// https://fetch.spec.whatwg.org/#methods
|
||||
let method = options.method.toUpperCase();
|
||||
// replace :varname with {varname} to make it RFC 6570 compatible
|
||||
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
|
||||
let headers = Object.assign({}, options.headers);
|
||||
let body;
|
||||
let parameters = omit(options, [
|
||||
"method",
|
||||
"baseUrl",
|
||||
"url",
|
||||
"headers",
|
||||
"request",
|
||||
"mediaType"
|
||||
]);
|
||||
// extract variable names from URL to calculate remaining variables later
|
||||
const urlVariableNames = extractUrlVariableNames(url);
|
||||
url = parseUrl(url).expand(parameters);
|
||||
if (!/^http/.test(url)) {
|
||||
url = options.baseUrl + url;
|
||||
}
|
||||
const omittedParameters = Object.keys(options)
|
||||
.filter(option => urlVariableNames.includes(option))
|
||||
.concat("baseUrl");
|
||||
const remainingParameters = omit(parameters, omittedParameters);
|
||||
const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
|
||||
if (!isBinaryRequset) {
|
||||
if (options.mediaType.format) {
|
||||
// e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
|
||||
headers.accept = headers.accept
|
||||
.split(/,/)
|
||||
.map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`))
|
||||
.join(",");
|
||||
}
|
||||
if (options.mediaType.previews.length) {
|
||||
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
|
||||
headers.accept = previewsFromAcceptHeader
|
||||
.concat(options.mediaType.previews)
|
||||
.map(preview => {
|
||||
const format = options.mediaType.format
|
||||
? `.${options.mediaType.format}`
|
||||
: "+json";
|
||||
return `application/vnd.github.${preview}-preview${format}`;
|
||||
})
|
||||
.join(",");
|
||||
}
|
||||
}
|
||||
// for GET/HEAD requests, set URL query parameters from remaining parameters
|
||||
// for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
|
||||
if (["GET", "HEAD"].includes(method)) {
|
||||
url = addQueryParameters(url, remainingParameters);
|
||||
}
|
||||
else {
|
||||
if ("data" in remainingParameters) {
|
||||
body = remainingParameters.data;
|
||||
}
|
||||
else {
|
||||
if (Object.keys(remainingParameters).length) {
|
||||
body = remainingParameters;
|
||||
}
|
||||
else {
|
||||
headers["content-length"] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// default content-type for JSON if body is set
|
||||
if (!headers["content-type"] && typeof body !== "undefined") {
|
||||
headers["content-type"] = "application/json; charset=utf-8";
|
||||
}
|
||||
// GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
|
||||
// fetch does not allow to set `content-length` header, but we can set body to an empty string
|
||||
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
||||
body = "";
|
||||
}
|
||||
// Only return body/request keys if present
|
||||
return Object.assign({ method, url, headers }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null);
|
||||
}
|
||||
|
||||
function endpointWithDefaults(defaults, route, options) {
|
||||
return parse(merge(defaults, route, options));
|
||||
}
|
||||
|
||||
function withDefaults(oldDefaults, newDefaults) {
|
||||
const DEFAULTS = merge(oldDefaults, newDefaults);
|
||||
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
|
||||
return Object.assign(endpoint, {
|
||||
DEFAULTS,
|
||||
defaults: withDefaults.bind(null, DEFAULTS),
|
||||
merge: merge.bind(null, DEFAULTS),
|
||||
parse
|
||||
});
|
||||
}
|
||||
|
||||
const VERSION = "5.5.1";
|
||||
|
||||
const userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
|
||||
// DEFAULTS has all properties set that EndpointOptions has, except url.
|
||||
// So we use RequestParameters and add method as additional required property.
|
||||
const DEFAULTS = {
|
||||
method: "GET",
|
||||
baseUrl: "https://api.github.com",
|
||||
headers: {
|
||||
accept: "application/vnd.github.v3+json",
|
||||
"user-agent": userAgent
|
||||
},
|
||||
mediaType: {
|
||||
format: "",
|
||||
previews: []
|
||||
}
|
||||
};
|
||||
|
||||
const endpoint = withDefaults(null, DEFAULTS);
|
||||
|
||||
export { endpoint };
|
||||
//# sourceMappingURL=index.js.map
|
||||
-1
File diff suppressed because one or more lines are too long
-7
@@ -1,7 +0,0 @@
|
||||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
|
||||
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
# universal-user-agent
|
||||
|
||||
> Get a user agent string in both browser and node
|
||||
|
||||
[](https://www.npmjs.com/package/universal-user-agent)
|
||||
[](https://travis-ci.com/gr2m/universal-user-agent)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
```js
|
||||
const { getUserAgent } = require("universal-user-agent");
|
||||
// or import { getUserAgent } from "universal-user-agent";
|
||||
|
||||
const userAgent = getUserAgent();
|
||||
// userAgent will look like this
|
||||
// in browser: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0"
|
||||
// in node: Node.js/v8.9.4 (macOS High Sierra; x64)
|
||||
```
|
||||
|
||||
## Credits
|
||||
|
||||
The Node implementation was originally inspired by [default-user-agent](https://www.npmjs.com/package/default-user-agent).
|
||||
|
||||
## License
|
||||
|
||||
[ISC](LICENSE.md)
|
||||
Generated
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var osName = _interopDefault(require('os-name'));
|
||||
|
||||
function getUserAgent() {
|
||||
try {
|
||||
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
|
||||
} catch (error) {
|
||||
if (/wmic os get Caption/.test(error.message)) {
|
||||
return "Windows <version undetectable>";
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
exports.getUserAgent = getUserAgent;
|
||||
//# sourceMappingURL=index.js.map
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.js","sources":["../dist-src/node.js"],"sourcesContent":["import osName from \"os-name\";\nexport function getUserAgent() {\n try {\n return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;\n }\n catch (error) {\n if (/wmic os get Caption/.test(error.message)) {\n return \"Windows <version undetectable>\";\n }\n throw error;\n }\n}\n"],"names":["getUserAgent","process","version","substr","osName","arch","error","test","message"],"mappings":";;;;;;;;AACO,SAASA,YAAT,GAAwB;MACvB;WACQ,WAAUC,OAAO,CAACC,OAAR,CAAgBC,MAAhB,CAAuB,CAAvB,CAA0B,KAAIC,MAAM,EAAG,KAAIH,OAAO,CAACI,IAAK,GAA1E;GADJ,CAGA,OAAOC,KAAP,EAAc;QACN,sBAAsBC,IAAtB,CAA2BD,KAAK,CAACE,OAAjC,CAAJ,EAA+C;aACpC,gCAAP;;;UAEEF,KAAN;;;;;;"}
|
||||
Generated
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
export function getUserAgent() {
|
||||
return navigator.userAgent;
|
||||
}
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
export { getUserAgent } from "./node";
|
||||
Generated
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
import osName from "os-name";
|
||||
export function getUserAgent() {
|
||||
try {
|
||||
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
|
||||
}
|
||||
catch (error) {
|
||||
if (/wmic os get Caption/.test(error.message)) {
|
||||
return "Windows <version undetectable>";
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
export declare function getUserAgent(): string;
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
export { getUserAgent } from "./node";
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
export declare function getUserAgent(): string;
|
||||
Generated
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
function getUserAgent() {
|
||||
return navigator.userAgent;
|
||||
}
|
||||
|
||||
export { getUserAgent };
|
||||
//# sourceMappingURL=index.js.map
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.js","sources":["../dist-src/browser.js"],"sourcesContent":["export function getUserAgent() {\n return navigator.userAgent;\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,GAAG;IAC3B,OAAO,SAAS,CAAC,SAAS,CAAC;CAC9B;;;;"}
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
{
|
||||
"_from": "universal-user-agent@^4.0.0",
|
||||
"_id": "universal-user-agent@4.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==",
|
||||
"_location": "/@octokit/endpoint/universal-user-agent",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "universal-user-agent@^4.0.0",
|
||||
"name": "universal-user-agent",
|
||||
"escapedName": "universal-user-agent",
|
||||
"rawSpec": "^4.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^4.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@octokit/endpoint"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz",
|
||||
"_shasum": "27da2ec87e32769619f68a14996465ea1cb9df16",
|
||||
"_spec": "universal-user-agent@^4.0.0",
|
||||
"_where": "/Users/shim.taewon/Documents/sticky-pull-request-comment/node_modules/@octokit/endpoint",
|
||||
"bugs": {
|
||||
"url": "https://github.com/gr2m/universal-user-agent/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"os-name": "^3.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Get a user agent string in both browser and node",
|
||||
"devDependencies": {
|
||||
"@gr2m/pika-plugin-build-web": "^0.6.0-issue-84.1",
|
||||
"@pika/pack": "^0.5.0",
|
||||
"@pika/plugin-build-node": "^0.6.0",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.6.0",
|
||||
"@types/jest": "^24.0.18",
|
||||
"jest": "^24.9.0",
|
||||
"prettier": "^1.18.2",
|
||||
"semantic-release": "^15.9.15",
|
||||
"ts-jest": "^24.0.2",
|
||||
"typescript": "^3.6.2"
|
||||
},
|
||||
"files": [
|
||||
"dist-*/",
|
||||
"bin/"
|
||||
],
|
||||
"homepage": "https://github.com/gr2m/universal-user-agent#readme",
|
||||
"keywords": [],
|
||||
"license": "ISC",
|
||||
"main": "dist-node/index.js",
|
||||
"module": "dist-web/index.js",
|
||||
"name": "universal-user-agent",
|
||||
"pika": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/gr2m/universal-user-agent.git"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"source": "dist-src/index.js",
|
||||
"types": "dist-types/index.d.ts",
|
||||
"version": "4.0.0"
|
||||
}
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"_from": "@octokit/endpoint@^5.5.0",
|
||||
"_id": "@octokit/endpoint@5.5.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg==",
|
||||
"_location": "/@octokit/endpoint",
|
||||
"_phantomChildren": {
|
||||
"os-name": "3.1.0"
|
||||
},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@octokit/endpoint@^5.5.0",
|
||||
"name": "@octokit/endpoint",
|
||||
"escapedName": "@octokit%2fendpoint",
|
||||
"scope": "@octokit",
|
||||
"rawSpec": "^5.5.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.5.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@octokit/request"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.1.tgz",
|
||||
"_shasum": "2eea81e110ca754ff2de11c79154ccab4ae16b3f",
|
||||
"_spec": "@octokit/endpoint@^5.5.0",
|
||||
"_where": "/Users/shim.taewon/Documents/sticky-pull-request-comment/node_modules/@octokit/request",
|
||||
"bugs": {
|
||||
"url": "https://github.com/octokit/endpoint.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deno": "dist-web/index.js",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^2.0.0",
|
||||
"is-plain-object": "^3.0.0",
|
||||
"universal-user-agent": "^4.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Turns REST API endpoints into generic request options",
|
||||
"devDependencies": {
|
||||
"@pika/pack": "^0.5.0",
|
||||
"@pika/plugin-build-node": "^0.7.0",
|
||||
"@pika/plugin-build-web": "^0.7.0",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.7.0",
|
||||
"@types/jest": "^24.0.11",
|
||||
"jest": "^24.7.1",
|
||||
"prettier": "1.18.2",
|
||||
"semantic-release": "^15.13.8",
|
||||
"semantic-release-plugin-update-version-in-files": "^1.0.0",
|
||||
"ts-jest": "^24.0.2",
|
||||
"typescript": "^3.4.5"
|
||||
},
|
||||
"files": [
|
||||
"dist-*/",
|
||||
"bin/"
|
||||
],
|
||||
"homepage": "https://github.com/octokit/endpoint.js#readme",
|
||||
"keywords": [
|
||||
"octokit",
|
||||
"github",
|
||||
"api",
|
||||
"rest"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "dist-node/index.js",
|
||||
"name": "@octokit/endpoint",
|
||||
"pika": true,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/octokit/endpoint.js.git"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"source": "dist-src/index.js",
|
||||
"types": "dist-types/index.d.ts",
|
||||
"version": "5.5.1"
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-292
@@ -1,292 +0,0 @@
|
||||
# graphql.js
|
||||
|
||||
> GitHub GraphQL API client for browsers and Node
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/graphql)
|
||||
[](https://travis-ci.com/octokit/graphql.js)
|
||||
[](https://coveralls.io/github/octokit/graphql.js)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [Errors](#errors)
|
||||
- [Writing tests](#writing-tests)
|
||||
- [License](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Usage
|
||||
|
||||
Send a simple query
|
||||
|
||||
```js
|
||||
const graphql = require('@octokit/graphql')
|
||||
const { repository } = await graphql(`{
|
||||
repository(owner:"octokit", name:"graphql.js") {
|
||||
issues(last:3) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`, {
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
⚠️ Do not use [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) in the query strings as they make your code vulnerable to query injection attacks (see [#2](https://github.com/octokit/graphql.js/issues/2)). Use variables instead:
|
||||
|
||||
```js
|
||||
const graphql = require('@octokit/graphql')
|
||||
const { lastIssues } = await graphql(`query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||
repository(owner:$owner, name:$repo) {
|
||||
issues(last:$num) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`, {
|
||||
owner: 'octokit',
|
||||
repo: 'graphql.js'
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Create two new clients and set separate default configs for them.
|
||||
|
||||
```js
|
||||
const graphql1 = require('@octokit/graphql').defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
|
||||
const graphql2 = require('@octokit/graphql').defaults({
|
||||
headers: {
|
||||
authorization: `token foobar`
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Create two clients, the second inherits config from the first.
|
||||
|
||||
```js
|
||||
const graphql1 = require('@octokit/graphql').defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
|
||||
const graphql2 = graphql1.defaults({
|
||||
headers: {
|
||||
'user-agent': 'my-user-agent/v1.2.3'
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Create a new client with default options and run query
|
||||
|
||||
```js
|
||||
const graphql = require('@octokit/graphql').defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
const { repository } = await graphql(`{
|
||||
repository(owner:"octokit", name:"graphql.js") {
|
||||
issues(last:3) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`)
|
||||
```
|
||||
|
||||
Pass query together with headers and variables
|
||||
|
||||
```js
|
||||
const graphql = require('@octokit/graphql')
|
||||
const { lastIssues } = await graphql({
|
||||
query: `query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||
repository(owner:$owner, name:$repo) {
|
||||
issues(last:$num) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`,
|
||||
owner: 'octokit',
|
||||
repo: 'graphql.js'
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Use with GitHub Enterprise
|
||||
|
||||
```js
|
||||
const graphql = require('@octokit/graphql').defaults({
|
||||
baseUrl: 'https://github-enterprise.acme-inc.com/api',
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
const { repository } = await graphql(`{
|
||||
repository(owner:"acme-project", name:"acme-repo") {
|
||||
issues(last:3) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`)
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
In case of a GraphQL error, `error.message` is set to the first error from the response’s `errors` array. All errors can be accessed at `error.errors`. `error.request` has the request options such as query, variables and headers set for easier debugging.
|
||||
|
||||
```js
|
||||
const graphql = require('@octokit/graphql').defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
const query = `{
|
||||
viewer {
|
||||
bioHtml
|
||||
}
|
||||
}`
|
||||
|
||||
try {
|
||||
const result = await graphql(query)
|
||||
} catch (error) {
|
||||
// server responds with
|
||||
// {
|
||||
// "data": null,
|
||||
// "errors": [{
|
||||
// "message": "Field 'bioHtml' doesn't exist on type 'User'",
|
||||
// "locations": [{
|
||||
// "line": 3,
|
||||
// "column": 5
|
||||
// }]
|
||||
// }]
|
||||
// }
|
||||
|
||||
console.log('Request failed:', error.request) // { query, variables: {}, headers: { authorization: 'token secret123' } }
|
||||
console.log(error.message) // Field 'bioHtml' doesn't exist on type 'User'
|
||||
}
|
||||
```
|
||||
|
||||
## Partial responses
|
||||
|
||||
A GraphQL query may respond with partial data accompanied by errors. In this case we will throw an error but the partial data will still be accessible through `error.data`
|
||||
|
||||
```js
|
||||
const graphql = require('@octokit/graphql').defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`
|
||||
}
|
||||
})
|
||||
const query = `{
|
||||
repository(name: "probot", owner: "probot") {
|
||||
name
|
||||
ref(qualifiedName: "master") {
|
||||
target {
|
||||
... on Commit {
|
||||
history(first: 25, after: "invalid cursor") {
|
||||
nodes {
|
||||
message
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
try {
|
||||
const result = await graphql(query)
|
||||
} catch (error) {
|
||||
// server responds with
|
||||
// {
|
||||
// "data": {
|
||||
// "repository": {
|
||||
// "name": "probot",
|
||||
// "ref": null
|
||||
// }
|
||||
// },
|
||||
// "errors": [
|
||||
// {
|
||||
// "type": "INVALID_CURSOR_ARGUMENTS",
|
||||
// "path": [
|
||||
// "repository",
|
||||
// "ref",
|
||||
// "target",
|
||||
// "history"
|
||||
// ],
|
||||
// "locations": [
|
||||
// {
|
||||
// "line": 7,
|
||||
// "column": 11
|
||||
// }
|
||||
// ],
|
||||
// "message": "`invalid cursor` does not appear to be a valid cursor."
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
|
||||
console.log('Request failed:', error.request) // { query, variables: {}, headers: { authorization: 'token secret123' } }
|
||||
console.log(error.message) // `invalid cursor` does not appear to be a valid cursor.
|
||||
console.log(error.data) // { repository: { name: 'probot', ref: null } }
|
||||
}
|
||||
```
|
||||
|
||||
## Writing tests
|
||||
|
||||
You can pass a replacement for [the built-in fetch implementation](https://github.com/bitinn/node-fetch) as `request.fetch` option. For example, using [fetch-mock](http://www.wheresrhys.co.uk/fetch-mock/) works great to write tests
|
||||
|
||||
```js
|
||||
const assert = require('assert')
|
||||
const fetchMock = require('fetch-mock/es5/server')
|
||||
|
||||
const graphql = require('@octokit/graphql')
|
||||
|
||||
graphql('{ viewer { login } }', {
|
||||
headers: {
|
||||
authorization: 'token secret123'
|
||||
},
|
||||
request: {
|
||||
fetch: fetchMock.sandbox()
|
||||
.post('https://api.github.com/graphql', (url, options) => {
|
||||
assert.strictEqual(options.headers.authorization, 'token secret123')
|
||||
assert.strictEqual(options.body, '{"query":"{ viewer { login } }"}', 'Sends correct query')
|
||||
return { data: {} }
|
||||
})
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
const { request } = require('@octokit/request')
|
||||
const getUserAgent = require('universal-user-agent')
|
||||
|
||||
const version = require('./package.json').version
|
||||
const userAgent = `octokit-graphql.js/${version} ${getUserAgent()}`
|
||||
|
||||
const withDefaults = require('./lib/with-defaults')
|
||||
|
||||
module.exports = withDefaults(request, {
|
||||
method: 'POST',
|
||||
url: '/graphql',
|
||||
headers: {
|
||||
'user-agent': userAgent
|
||||
}
|
||||
})
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
module.exports = class GraphqlError extends Error {
|
||||
constructor (request, response) {
|
||||
const message = response.data.errors[0].message
|
||||
super(message)
|
||||
|
||||
Object.assign(this, response.data)
|
||||
this.name = 'GraphqlError'
|
||||
this.request = request
|
||||
|
||||
// Maintains proper stack trace (only available on V8)
|
||||
/* istanbul ignore next */
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, this.constructor)
|
||||
}
|
||||
}
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
module.exports = graphql
|
||||
|
||||
const GraphqlError = require('./error')
|
||||
|
||||
const NON_VARIABLE_OPTIONS = ['method', 'baseUrl', 'url', 'headers', 'request', 'query']
|
||||
|
||||
function graphql (request, query, options) {
|
||||
if (typeof query === 'string') {
|
||||
options = Object.assign({ query }, options)
|
||||
} else {
|
||||
options = query
|
||||
}
|
||||
|
||||
const requestOptions = Object.keys(options).reduce((result, key) => {
|
||||
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
||||
result[key] = options[key]
|
||||
return result
|
||||
}
|
||||
|
||||
if (!result.variables) {
|
||||
result.variables = {}
|
||||
}
|
||||
|
||||
result.variables[key] = options[key]
|
||||
return result
|
||||
}, {})
|
||||
|
||||
return request(requestOptions)
|
||||
.then(response => {
|
||||
if (response.data.errors) {
|
||||
throw new GraphqlError(requestOptions, response)
|
||||
}
|
||||
|
||||
return response.data.data
|
||||
})
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
module.exports = withDefaults
|
||||
|
||||
const graphql = require('./graphql')
|
||||
|
||||
function withDefaults (request, newDefaults) {
|
||||
const newRequest = request.defaults(newDefaults)
|
||||
const newApi = function (query, options) {
|
||||
return graphql(newRequest, query, options)
|
||||
}
|
||||
|
||||
newApi.defaults = withDefaults.bind(null, newRequest)
|
||||
return newApi
|
||||
}
|
||||
-119
@@ -1,119 +0,0 @@
|
||||
{
|
||||
"_from": "@octokit/graphql@^2.0.1",
|
||||
"_id": "@octokit/graphql@2.1.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==",
|
||||
"_location": "/@octokit/graphql",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@octokit/graphql@^2.0.1",
|
||||
"name": "@octokit/graphql",
|
||||
"escapedName": "@octokit%2fgraphql",
|
||||
"scope": "@octokit",
|
||||
"rawSpec": "^2.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@actions/github"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz",
|
||||
"_shasum": "60c058a0ed5fa242eca6f938908d95fd1a2f4b92",
|
||||
"_spec": "@octokit/graphql@^2.0.1",
|
||||
"_where": "/Users/shim.taewon/Documents/sticky-pull-request-comment/node_modules/@actions/github",
|
||||
"author": {
|
||||
"name": "Gregor Martynus",
|
||||
"url": "https://github.com/gr2m"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/octokit/graphql.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"bundlesize": [
|
||||
{
|
||||
"path": "./dist/octokit-graphql.min.js.gz",
|
||||
"maxSize": "5KB"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@octokit/request": "^5.0.0",
|
||||
"universal-user-agent": "^2.0.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "GitHub GraphQL API client for browsers and Node",
|
||||
"devDependencies": {
|
||||
"chai": "^4.2.0",
|
||||
"compression-webpack-plugin": "^2.0.0",
|
||||
"coveralls": "^3.0.3",
|
||||
"cypress": "^3.1.5",
|
||||
"fetch-mock": "^7.3.1",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mocha": "^6.0.0",
|
||||
"npm-run-all": "^4.1.3",
|
||||
"nyc": "^14.0.0",
|
||||
"semantic-release": "^15.13.3",
|
||||
"simple-mock": "^0.8.0",
|
||||
"standard": "^12.0.1",
|
||||
"webpack": "^4.29.6",
|
||||
"webpack-bundle-analyzer": "^3.1.0",
|
||||
"webpack-cli": "^3.2.3"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/octokit/graphql.js#readme",
|
||||
"keywords": [
|
||||
"octokit",
|
||||
"github",
|
||||
"api",
|
||||
"graphql"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "@octokit/graphql",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"release": {
|
||||
"publish": [
|
||||
"@semantic-release/npm",
|
||||
{
|
||||
"path": "@semantic-release/github",
|
||||
"assets": [
|
||||
"dist/*",
|
||||
"!dist/*.map.gz"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/octokit/graphql.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm-run-all build:*",
|
||||
"build:development": "webpack --mode development --entry . --output-library=octokitGraphql --output=./dist/octokit-graphql.js --profile --json > dist/bundle-stats.json",
|
||||
"build:production": "webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=octokitGraphql --output-path=./dist --output-filename=octokit-graphql.min.js --devtool source-map",
|
||||
"bundle-report": "webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html",
|
||||
"coverage": "nyc report --reporter=html && open coverage/index.html",
|
||||
"coverage:upload": "nyc report --reporter=text-lcov | coveralls",
|
||||
"prebuild": "mkdirp dist/",
|
||||
"pretest": "standard",
|
||||
"test": "nyc mocha test/*-test.js",
|
||||
"test:browser": "cypress run --browser chrome"
|
||||
},
|
||||
"standard": {
|
||||
"globals": [
|
||||
"describe",
|
||||
"before",
|
||||
"beforeEach",
|
||||
"afterEach",
|
||||
"after",
|
||||
"it",
|
||||
"expect"
|
||||
]
|
||||
},
|
||||
"version": "2.1.3"
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-68
@@ -1,68 +0,0 @@
|
||||
# http-error.js
|
||||
|
||||
> Error class for Octokit request errors
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/request-error)
|
||||
[](https://travis-ci.com/octokit/request-error.js)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/request-error</code> directly from <a href="https://cdn.pika.dev">cdn.pika.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { RequestError } from "https://cdn.pika.dev/@octokit/request-error";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/request-error</code>
|
||||
|
||||
```js
|
||||
const { RequestError } = require("@octokit/request-error");
|
||||
// or: import { RequestError } from "@octokit/request-error";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const error = new RequestError("Oops", 500, {
|
||||
headers: {
|
||||
"x-github-request-id": "1:2:3:4"
|
||||
}, // response headers
|
||||
request: {
|
||||
method: "POST",
|
||||
url: "https://api.github.com/foo",
|
||||
body: {
|
||||
bar: "baz"
|
||||
},
|
||||
headers: {
|
||||
authorization: "token secret123"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
error.message; // Oops
|
||||
error.status; // 500
|
||||
error.headers; // { 'x-github-request-id': '1:2:3:4' }
|
||||
error.request.method; // POST
|
||||
error.request.url; // https://api.github.com/foo
|
||||
error.request.body; // { bar: 'baz' }
|
||||
error.request.headers; // { authorization: 'token [REDACTED]' }
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var deprecation = require('deprecation');
|
||||
var once = _interopDefault(require('once'));
|
||||
|
||||
const logOnce = once(deprecation => console.warn(deprecation));
|
||||
/**
|
||||
* Error with extra properties to help with debugging
|
||||
*/
|
||||
|
||||
class RequestError extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message); // Maintains proper stack trace (only available on V8)
|
||||
|
||||
/* istanbul ignore next */
|
||||
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
|
||||
this.name = "HttpError";
|
||||
this.status = statusCode;
|
||||
Object.defineProperty(this, "code", {
|
||||
get() {
|
||||
logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
});
|
||||
this.headers = options.headers || {}; // redact request credentials without mutating original request options
|
||||
|
||||
const requestCopy = Object.assign({}, options.request);
|
||||
|
||||
if (options.request.headers.authorization) {
|
||||
requestCopy.headers = Object.assign({}, options.request.headers, {
|
||||
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
|
||||
});
|
||||
}
|
||||
|
||||
requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
|
||||
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
|
||||
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
|
||||
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
|
||||
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
|
||||
this.request = requestCopy;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.RequestError = RequestError;
|
||||
//# sourceMappingURL=index.js.map
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["import { Deprecation } from \"deprecation\";\nimport once from \"once\";\nconst logOnce = once((deprecation) => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\nexport class RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message);\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n this.name = \"HttpError\";\n this.status = statusCode;\n Object.defineProperty(this, \"code\", {\n get() {\n logOnce(new Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n });\n this.headers = options.headers || {};\n // redact request credentials without mutating original request options\n const requestCopy = Object.assign({}, options.request);\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n requestCopy.url = requestCopy.url\n // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\")\n // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy;\n }\n}\n"],"names":["logOnce","once","deprecation","console","warn","RequestError","Error","constructor","message","statusCode","options","captureStackTrace","name","status","Object","defineProperty","get","Deprecation","headers","requestCopy","assign","request","authorization","replace","url"],"mappings":";;;;;;;;;AAEA,MAAMA,OAAO,GAAGC,IAAI,CAAEC,WAAD,IAAiBC,OAAO,CAACC,IAAR,CAAaF,WAAb,CAAlB,CAApB;;;;;AAIA,AAAO,MAAMG,YAAN,SAA2BC,KAA3B,CAAiC;EACpCC,WAAW,CAACC,OAAD,EAAUC,UAAV,EAAsBC,OAAtB,EAA+B;UAChCF,OAAN,EADsC;;;;QAIlCF,KAAK,CAACK,iBAAV,EAA6B;MACzBL,KAAK,CAACK,iBAAN,CAAwB,IAAxB,EAA8B,KAAKJ,WAAnC;;;SAECK,IAAL,GAAY,WAAZ;SACKC,MAAL,GAAcJ,UAAd;IACAK,MAAM,CAACC,cAAP,CAAsB,IAAtB,EAA4B,MAA5B,EAAoC;MAChCC,GAAG,GAAG;QACFhB,OAAO,CAAC,IAAIiB,uBAAJ,CAAgB,0EAAhB,CAAD,CAAP;eACOR,UAAP;;;KAHR;SAMKS,OAAL,GAAeR,OAAO,CAACQ,OAAR,IAAmB,EAAlC,CAfsC;;UAiBhCC,WAAW,GAAGL,MAAM,CAACM,MAAP,CAAc,EAAd,EAAkBV,OAAO,CAACW,OAA1B,CAApB;;QACIX,OAAO,CAACW,OAAR,CAAgBH,OAAhB,CAAwBI,aAA5B,EAA2C;MACvCH,WAAW,CAACD,OAAZ,GAAsBJ,MAAM,CAACM,MAAP,CAAc,EAAd,EAAkBV,OAAO,CAACW,OAAR,CAAgBH,OAAlC,EAA2C;QAC7DI,aAAa,EAAEZ,OAAO,CAACW,OAAR,CAAgBH,OAAhB,CAAwBI,aAAxB,CAAsCC,OAAtC,CAA8C,MAA9C,EAAsD,aAAtD;OADG,CAAtB;;;IAIJJ,WAAW,CAACK,GAAZ,GAAkBL,WAAW,CAACK,GAAZ;;KAGbD,OAHa,CAGL,sBAHK,EAGmB,0BAHnB;;KAMbA,OANa,CAML,qBANK,EAMkB,yBANlB,CAAlB;SAOKF,OAAL,GAAeF,WAAf;;;;;;;"}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
import { Deprecation } from "deprecation";
|
||||
import once from "once";
|
||||
const logOnce = once((deprecation) => console.warn(deprecation));
|
||||
/**
|
||||
* Error with extra properties to help with debugging
|
||||
*/
|
||||
export class RequestError extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
// Maintains proper stack trace (only available on V8)
|
||||
/* istanbul ignore next */
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
this.name = "HttpError";
|
||||
this.status = statusCode;
|
||||
Object.defineProperty(this, "code", {
|
||||
get() {
|
||||
logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
|
||||
return statusCode;
|
||||
}
|
||||
});
|
||||
this.headers = options.headers || {};
|
||||
// redact request credentials without mutating original request options
|
||||
const requestCopy = Object.assign({}, options.request);
|
||||
if (options.request.headers.authorization) {
|
||||
requestCopy.headers = Object.assign({}, options.request.headers, {
|
||||
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
|
||||
});
|
||||
}
|
||||
requestCopy.url = requestCopy.url
|
||||
// client_id & client_secret can be passed as URL query parameters to increase rate limit
|
||||
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
|
||||
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]")
|
||||
// OAuth tokens can be passed as URL query parameters, although it is not recommended
|
||||
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
|
||||
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
|
||||
this.request = requestCopy;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user