mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-14 22:29:17 +08:00
Compare commits
910 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4b09552702 | ||
|
aa83d0c2cf | ||
|
ababa3d330 | ||
|
e46b3c13b3 | ||
|
043abd3e23 | ||
|
ff76ce4ba8 | ||
|
f29c5724c6 | ||
|
2f6fbdfbd5 | ||
|
ac010ec1f2 | ||
|
945f31d648 | ||
|
146f6aa3aa | ||
|
bd241a0d4d | ||
|
a1da173b8b | ||
|
0b7567fde6 | ||
|
a16b61f078 | ||
|
fa8661b296 | ||
|
4f9cc6602d | ||
|
9c75028a53 | ||
|
5049354438 | ||
|
4eb285e828 | ||
|
cdc09a3baa | ||
|
d830378ec6 | ||
|
80daa1d144 | ||
|
108285e909 | ||
|
99c95ff54e | ||
|
1f4653792d | ||
|
010129e8cf | ||
|
c04cfb71e7 | ||
|
04c3b0d15d | ||
|
3c68be13b3 | ||
|
4742e740d0 | ||
|
5e45b5dcd8 | ||
|
6ee61b79d5 | ||
|
417f92fdd8 | ||
|
e2a4f025c9 | ||
|
74d2f4c379 | ||
|
e69643f175 | ||
|
f026ea2bbe | ||
|
6b2414c9be | ||
|
6cdec55d3f | ||
|
d8bf9f86a3 | ||
|
b3874735d6 | ||
|
b52b41fae2 | ||
|
a7ddc29c35 | ||
|
a9641a0bc8 | ||
|
5e1c7e7bc6 | ||
|
c44a4fc731 | ||
|
6c5e89164c | ||
|
467dcabae7 | ||
|
1f4db34371 | ||
|
b724f576a5 | ||
|
bcf9735214 | ||
|
3ae1228acc | ||
|
a3f40baff8 | ||
|
682a3a735c | ||
|
38b25433b9 | ||
|
ae221b7c50 | ||
|
89244b1cbe | ||
|
279de227eb | ||
|
b66906400d | ||
|
6bba92debc | ||
|
0129e86d88 | ||
|
4d1ecb8e1c | ||
|
79ee348845 | ||
|
cb0dcd7031 | ||
|
86d9e12738 | ||
|
61ec32a536 | ||
|
92dfa99669 | ||
|
d71bc23aad | ||
|
87c3e9ec3f | ||
|
1cb084f5ba | ||
|
5240c0d842 | ||
|
4dc558f966 | ||
|
732722abc2 | ||
|
48e85c7330 | ||
|
7ba1270da4 | ||
|
4daeb78d00 | ||
|
ae2cd31f2b | ||
|
99a8097f79 | ||
|
d04d1f508f | ||
|
7bd53a1270 | ||
|
8116766a7f | ||
|
a7ad69121d | ||
|
e47dc1fce9 | ||
|
1abfb872a4 | ||
|
e2eebc8cf5 | ||
|
e3d288aced | ||
|
65ebf11929 | ||
|
87231bc03a | ||
|
88b4d2aa92 | ||
|
579d4683a6 | ||
|
53672794bd | ||
|
0b3168d85f | ||
|
ecd56b0080 | ||
|
78ae7a2550 | ||
|
33763ce944 | ||
|
60f9fc9125 | ||
|
f120c354d4 | ||
|
08c4468107 | ||
|
aa3ded5f54 | ||
|
549cbccf20 | ||
|
02c096c7ae | ||
|
6224cceade | ||
|
e408c2b5b7 | ||
|
40ceb269a8 | ||
|
603b48d31e | ||
|
9029fb38f8 | ||
|
a849d5f5d1 | ||
|
0f35755941 | ||
|
8fac1ab7e4 | ||
|
d5f70ca9b6 | ||
|
f915517a64 | ||
|
17ee2a4317 | ||
|
c2307841f8 | ||
|
00849af781 | ||
|
0cf303c515 | ||
|
f09b4d7e2f | ||
|
04f8b72705 | ||
|
c00e237c63 | ||
|
0887d0ca82 | ||
|
177e73ec93 | ||
|
25ab86ef33 | ||
|
5f3ccc7a05 | ||
|
eaaca9a01b | ||
|
88391461a5 | ||
|
aeef856898 | ||
|
80c9fd5609 | ||
|
7181847f5f | ||
|
cf3131b96d | ||
|
1fa15b40ee | ||
|
6b5e721472 | ||
|
5c3786b93f | ||
|
30155ac2ce | ||
|
d75c9c68a6 | ||
|
3c6e26bf88 | ||
|
5c2402f854 | ||
|
0fbd122442 | ||
|
97d8bbdfe9 | ||
|
39e645cff9 | ||
|
a2a2b7b78d | ||
|
f0f1e893fc | ||
|
e76f1e7fdb | ||
|
a4ea9ceebb | ||
|
6add02d988 | ||
|
002d40c1b0 | ||
|
183ff8d4d1 | ||
|
d63c64bf05 | ||
|
79a96898c6 | ||
|
6552e845d6 | ||
|
6aa6599ce5 | ||
|
cc17d261c9 | ||
|
f2c58a7772 | ||
|
632be0ae48 | ||
|
61cf177907 | ||
|
f223cf5bac | ||
|
67f80d94a1 | ||
|
0051bc94f3 | ||
|
a9ba7acf74 | ||
|
5a83fe7930 | ||
|
d2f70def42 | ||
|
b4f72218ba | ||
|
357abd46e4 | ||
|
ea4ed94409 | ||
|
15a019fd2a | ||
|
842eecdfb6 | ||
|
627df3d602 | ||
|
c57ac395ad | ||
|
f8de6794a9 | ||
|
a2a8d7acd1 | ||
|
339caee9d4 | ||
|
0912f94a86 | ||
|
f59da029d3 | ||
|
373f7f263a | ||
|
00e2f338db | ||
|
31c15f0329 | ||
|
6f6875cdf6 | ||
|
ee58d74b7a | ||
|
67383c90a3 | ||
|
f2f45dd826 | ||
|
69c02d4e82 | ||
|
b8ecadfc08 | ||
|
66f12e737e | ||
|
5a7e52de3d | ||
|
599324c6ed | ||
|
0d67ec5c39 | ||
|
78b3816969 | ||
|
43f2073e60 | ||
|
486938a015 | ||
|
883423edd8 | ||
|
92c7c21410 | ||
|
65d77f816a | ||
|
2c0c03e6f4 | ||
|
28958bab3a | ||
|
aca9d72df7 | ||
|
c68a9bf36e | ||
|
773d4316b8 | ||
|
33d882af54 | ||
|
93bd8c5f6d | ||
|
1008c8c81c | ||
|
e9cc68c240 | ||
|
884a0224fd | ||
|
e5d60a65a4 | ||
|
06aa22c0f9 | ||
|
cc91d0e9f8 | ||
|
45065d5c03 | ||
|
2c16db0f50 | ||
|
589f1617f5 | ||
|
32e33dcd3a | ||
|
1977c44664 | ||
|
bd8c6b06eb | ||
|
ae7759a398 | ||
|
9b7ce2a171 | ||
|
983978086a | ||
|
7859c9b784 | ||
|
fd54e565f4 | ||
|
2c6daf7153 | ||
|
8206a5f364 | ||
|
cba22ba760 | ||
|
87c1b90704 | ||
|
411de78882 | ||
|
9209134025 | ||
|
2ae4e44c71 | ||
|
20411ac459 | ||
|
76446f8a5e | ||
|
8fc4f66b0e | ||
|
6932db2544 | ||
|
16b8f766df | ||
|
ffa3183092 | ||
|
afad39bf81 | ||
|
29aefb7700 | ||
|
0725e5789b | ||
|
3b42e19751 | ||
|
fe2eb19a96 | ||
|
25b90d1c7e | ||
|
416f539fb4 | ||
|
32c9288f55 | ||
|
da1b4ad62b | ||
|
b992418825 | ||
|
6c8719badb | ||
|
47d01f16d3 | ||
|
5e5dc6d02e | ||
|
7af79a873e | ||
|
dd7d778958 | ||
|
e3aa46d23b | ||
|
2306f39f4e | ||
|
64b46b4226 | ||
|
1a7c3d89ae | ||
|
679dbf02f6 | ||
|
25b12e2a24 | ||
|
2f463a5ad5 | ||
|
f94667a25c | ||
|
fdfb4d88a0 | ||
|
072d16c439 | ||
|
7166f2caa4 | ||
|
e3b45f2700 | ||
|
1808965241 | ||
|
a5f971f112 | ||
|
087a759f90 | ||
|
9af6a68dde | ||
|
811c45844b | ||
|
de7ea6f8ef | ||
|
1bf4b35fd8 | ||
|
44a2b4403c | ||
|
2bef62f818 | ||
|
2c04d6b595 | ||
|
f2ac8b62c4 | ||
|
402af2bd61 | ||
|
e1448a73ca | ||
|
2eea5d7a12 | ||
|
765cf1194e | ||
|
b4af807921 | ||
|
05d272de6c | ||
|
f1f4f15397 | ||
|
97637bffb0 | ||
|
1304921c60 | ||
|
da72d057b9 | ||
|
ac45008338 | ||
|
414c92c5ff | ||
|
9084ef1cda | ||
|
da398914f7 | ||
|
cf3948a236 | ||
|
a762c3ec54 | ||
|
d4f052f1e8 | ||
|
8a7e1fb6f4 | ||
|
fb2c292cba | ||
|
3cc0a55ff5 | ||
|
8b39fa2270 | ||
|
1226087547 | ||
|
c006717cf0 | ||
|
2fa23228a5 | ||
|
2b83a4b24b | ||
|
46202b8118 | ||
|
4403b8b8f3 | ||
|
f1e14e1adb | ||
|
c921422e37 | ||
|
7954f3d89e | ||
|
c188bee6f9 | ||
|
150e20f82d | ||
|
e93815b9d9 | ||
|
cd6de7d5f9 | ||
|
aa8658fb62 | ||
|
2e09f809f8 | ||
|
7249b6ae12 | ||
|
892ca34305 | ||
|
127e2d7a36 | ||
|
d7ab6dea49 | ||
|
e8cba386c2 | ||
|
88eb3e4384 | ||
|
d3d121d594 | ||
|
9852ec05a9 | ||
|
b19f8b8110 | ||
|
cc6f656fa1 | ||
|
834306ba27 | ||
|
40737e192d | ||
|
9856f8c8f8 | ||
|
84ef946460 | ||
|
52f1a5023a | ||
|
40515c605b | ||
|
7ea91005e5 | ||
|
57d746cd24 | ||
|
2c9f8534d2 | ||
|
4af0044e5e | ||
|
f34f14adb0 | ||
|
f29aeb91b3 | ||
|
be584e1ad2 | ||
|
eb802f35ce | ||
|
d936c20237 | ||
|
e363e57959 | ||
|
62644d80d0 | ||
|
d3619256d8 | ||
|
918154021f | ||
|
288fd14689 | ||
|
4a55c4533b | ||
|
d5e7428359 | ||
|
55635e9193 | ||
|
d4b79aef1f | ||
|
fde6b1864d | ||
|
69191bfb1c | ||
|
f7a748bfc9 | ||
|
90e01d5ddd | ||
|
e91a189d4c | ||
|
b5022f9875 | ||
|
ecd92e3bae | ||
|
913377f052 | ||
|
cdd482ae85 | ||
|
a99b730d28 | ||
|
edb4f3effe | ||
|
7e7d7dff41 | ||
|
69f1241495 | ||
|
f321f46f65 | ||
|
063f7de6c4 | ||
|
3edcc53d62 | ||
|
c618621f20 | ||
|
8f8bc4611e | ||
|
183add1cc5 | ||
|
3087a3437e | ||
|
6a30129b5b | ||
|
b1a4f2701c | ||
|
e831faae0e | ||
|
3102151215 | ||
|
a22219e8e4 | ||
|
b8eb1aeda4 | ||
|
a43024e6c0 | ||
|
e2a264646b | ||
|
b4ccfe80a6 | ||
|
193a76dc62 | ||
|
2d4d4fccc0 | ||
|
1d0fa1a644 | ||
|
95ad0343aa | ||
|
2decf4e752 | ||
|
9641296c3d | ||
|
0e596805b1 | ||
|
35c9643c95 | ||
|
3d71e70db9 | ||
|
b6958bc4fa | ||
|
068dc23d97 | ||
|
381a7b30d0 | ||
|
e4724d9526 | ||
|
b52df3c817 | ||
|
65a821ebc7 | ||
|
ebe02723dc | ||
|
bf41193762 | ||
|
628161d570 | ||
|
3623583f73 | ||
|
a0db9b66be | ||
|
0a4c122ea4 | ||
|
07f38c68fa | ||
|
94fb28f81c | ||
|
99df4b07a7 | ||
|
0ed12e5298 | ||
|
77ce5ecb49 | ||
|
e27e41d7ce | ||
|
d3a97d53a8 | ||
|
03d253207f | ||
|
47a5b8c834 | ||
|
1d14b37db2 | ||
|
9b425f80df | ||
|
fcead0e030 | ||
|
87b7480404 | ||
|
3baf850920 | ||
|
071f8cbc5a | ||
|
4b77300e3c | ||
|
1fd941c40a | ||
|
5b8ea1e7ee | ||
|
fe996f57a5 | ||
|
852bfb8e83 | ||
|
3f0d4cea48 | ||
|
facb2e7272 | ||
|
77a99cbdfe | ||
|
38add90c90 | ||
|
419385e998 | ||
|
584ffda459 | ||
|
eaab2e3404 | ||
|
33f5d6c1bf | ||
|
b427ba5d48 | ||
|
f06a7f8795 | ||
|
7d345152fb | ||
|
75c0bf7407 | ||
|
44a3899927 | ||
|
727890a27e | ||
|
4adbf1cc05 | ||
|
3dbd73271d | ||
|
6004cfef02 | ||
|
d04f65f985 | ||
|
1054f6a6b9 | ||
|
6c2db6e184 | ||
|
3ba244e8d4 | ||
|
8cc3a89d3b | ||
|
aedef9f283 | ||
|
2fa771f89e | ||
|
f0573f94d8 | ||
|
4c8cffc919 | ||
|
1e6dccf5ca | ||
|
bbdfb20061 | ||
|
7fd2e42a05 | ||
|
e93eed3ba7 | ||
|
cf805b9457 | ||
|
c4241b26fb | ||
|
4f6b15a24f | ||
|
42954117ce | ||
|
48b33dca85 | ||
|
45bd46f922 | ||
|
95792e1c0f | ||
|
66acd31e22 | ||
|
31256664b6 | ||
|
e90f765da6 | ||
|
725f7db867 | ||
|
46b269eb77 | ||
|
572a9b5eb9 | ||
|
d81433ecbd | ||
|
a284cb02e9 | ||
|
4682881fa3 | ||
|
9765b50692 | ||
|
772c200ac1 | ||
|
25e5ffa147 | ||
|
144799313d | ||
|
87e03f1be4 | ||
|
c77e4d0f87 | ||
|
5c575e8b27 | ||
|
1a9f7eb481 | ||
|
c6c5feba5e | ||
|
edd5ff366e | ||
|
f15a311467 | ||
|
274c177da0 | ||
|
24f34b2d74 | ||
|
a60f4671fe | ||
|
b3747cde80 | ||
|
04aa727212 | ||
|
3bdd7da7d7 | ||
|
f679a0dbd1 | ||
|
c41db76534 | ||
|
2cddccc8c3 | ||
|
cb130c640d | ||
|
3b4c9db644 | ||
|
803227f54b | ||
|
c1c219f526 | ||
|
b4f6cbe8b1 | ||
|
9cb40f4ee9 | ||
|
31a25da109 | ||
|
120ec442c1 | ||
|
e399650661 | ||
|
edfebaf01b | ||
|
9fba4cf667 | ||
|
9c2e2dd3ce | ||
|
e5f4a9361d | ||
|
2a142a0e74 | ||
|
abae70beb5 | ||
|
fe21b422bf | ||
|
0b2e6b45b9 | ||
|
c96473bb55 | ||
|
913650d45b | ||
|
82c33532d4 | ||
|
45708a0373 | ||
|
def0f6b635 | ||
|
b00ccd8065 | ||
|
afac56dcec | ||
|
f3be898a96 | ||
|
457c86c44a | ||
|
b9e600fd62 | ||
|
f89d8688b5 | ||
|
0762b5c9b9 | ||
|
c1ee410019 | ||
|
c04664fa6b | ||
|
b5c306f7ff | ||
|
50d8ed5bb6 | ||
|
d874503733 | ||
|
8955511f50 | ||
|
f034a3f485 | ||
|
c20c670c27 | ||
|
5a84f48f78 | ||
|
67200cfb5a | ||
|
37b07f70e3 | ||
|
48392f0c0c | ||
|
548761031c | ||
|
79bf213729 | ||
|
a1d6c2131c | ||
|
f74f5a30da | ||
|
fb9ff7fb2e | ||
|
16beda69bf | ||
|
a6d0886173 | ||
|
8146aedaa9 | ||
|
7af7235a08 | ||
|
42cf99685e | ||
|
74041e385e | ||
|
1f2df4a7dd | ||
|
61e2a61aea | ||
|
d7934f1bfb | ||
|
25119e64f4 | ||
|
05a7c4edd9 | ||
|
4c2d9ecb85 | ||
|
6b302fdd50 | ||
|
f80024481c | ||
|
ba912f746b | ||
|
02db90c5c8 | ||
|
b5599b36fd | ||
|
3f71ec211a | ||
|
5bfcd3f213 | ||
|
3226514b95 | ||
|
4f4235c78c | ||
|
079d48367e | ||
|
4fb3d60161 | ||
|
0c8fc2d5e6 | ||
|
4bf31e4520 | ||
|
0794e07c99 | ||
|
2b5ce90dc9 | ||
|
681dcab3fd | ||
|
70c0076457 | ||
|
a49e738c32 | ||
|
5d053d30d0 | ||
|
4cf5105929 | ||
|
2392f69e4d | ||
|
fecb564860 | ||
|
7259f5ccc2 | ||
|
c8397307b4 | ||
|
7dd962e52e | ||
|
ded3953565 | ||
|
71958c534b | ||
|
eca3d9d25e | ||
|
24d40fe124 | ||
|
19b0b66a7c | ||
|
23abc3124a | ||
|
866d7e715c | ||
|
6f45501409 | ||
|
bf46251210 | ||
|
f8993157cb | ||
|
9cf67ec63b | ||
|
0f5c65e140 | ||
|
2046290e2b | ||
|
600bb6caa2 | ||
|
20912713da | ||
|
674c2318ce | ||
|
0b4686e3a6 | ||
|
1029512144 | ||
|
6c430d988e | ||
|
6f6bb2661a | ||
|
d1700b5653 | ||
|
1b5d710b24 | ||
|
3667febec5 | ||
|
8546b0c56b | ||
|
2c04f23922 | ||
|
b15488f0b3 | ||
|
612f1f7579 | ||
|
af7aac1007 | ||
|
6896bd8b80 | ||
|
ad558aa8bd | ||
|
5051105279 | ||
|
99a89f661a | ||
|
8cd820bd66 | ||
|
f633b0f6b5 | ||
|
a2712f7b92 | ||
|
09b03c0bb1 | ||
|
afee929f89 | ||
|
4b17904d54 | ||
|
ce4e3beff1 | ||
|
3874723ac6 | ||
|
f0c76f03b6 | ||
|
b7f7b0dddb | ||
|
14e12e8e74 | ||
|
f30118c78e | ||
|
0cb61e91a5 | ||
|
42a6cdde0c | ||
|
250469649c | ||
|
a5a8912d3e | ||
|
5980f05de8 | ||
|
106f76b593 | ||
|
8a36f3edfc | ||
|
220a06da5e | ||
|
e193524bff | ||
|
7e92312ae4 | ||
|
3d656402e5 | ||
|
6901b8e8fc | ||
|
932df18147 | ||
|
c935046a93 | ||
|
ed8dfeaf86 | ||
|
381bc0b884 | ||
|
3914720f25 | ||
|
f53ab0c2a5 | ||
|
6b76e36ab3 | ||
|
a4205cbdd8 | ||
|
d753ac9b7d | ||
|
488b74cc9f | ||
|
16d58bea33 | ||
|
a8941b89c6 | ||
|
0413b987d2 | ||
|
9560cb6d44 | ||
|
b6cbae3580 | ||
|
29acb8eaee | ||
|
2e976845a6 | ||
|
31cdbe5222 | ||
|
c6333d41f0 | ||
|
4dfc201b55 | ||
|
b882ee3b2a | ||
|
ef42af2aef | ||
|
f2192db227 | ||
|
c6eab4153b | ||
|
05b3340742 | ||
|
ad23393e24 | ||
|
ac980646cf | ||
|
4fd6bd94b6 | ||
|
f86ecdfe86 | ||
|
31b8c32f32 | ||
|
91a3cf4cdd | ||
|
89628f0310 | ||
|
1ceef71a57 | ||
|
a72f52102f | ||
|
4d89a385db | ||
|
b6801e6334 | ||
|
19976af8e5 | ||
|
f444b0ede2 | ||
|
51c782389a | ||
|
f954d4113e | ||
|
2165a2b5fc | ||
|
688a3b3d0c | ||
|
d2b7688ae3 | ||
|
70411f07e7 | ||
|
3971a95d5a | ||
|
744621d13d | ||
|
5d0c4dbf35 | ||
|
738b4dea9f | ||
|
852c3a3ca6 | ||
|
7ddf1f7f90 | ||
|
58b4bf3981 | ||
|
a117f832ce | ||
|
2d9155e27f | ||
|
37213103b1 | ||
|
8b93bc127f | ||
|
aa82aebc1d | ||
|
e705cf59bc | ||
|
215b80c84b | ||
|
96f4391cd5 | ||
|
1f596ab2b7 | ||
|
3de5b2308f | ||
|
773665f4f0 | ||
|
929a7d0a6a | ||
|
d1afc2e8ce | ||
|
59c0ce4284 | ||
|
65dc7af084 | ||
|
4477775802 | ||
|
ce787cf051 | ||
|
73cf1d15d9 | ||
|
6cad446381 | ||
|
c4529a59aa | ||
|
646a1a3881 | ||
|
a17e9d437e | ||
|
fe5636cf95 | ||
|
8f1f960923 | ||
|
5b6baff975 | ||
|
938e1fa9f5 | ||
|
fef0123d21 | ||
|
6b188a8022 | ||
|
3203c05a3a | ||
|
ea6d487bc7 | ||
|
fcbee38355 | ||
|
89c0c9cbfa | ||
|
64f3c7fc7f | ||
|
e150cedd96 | ||
|
6d42c2c3b6 | ||
|
a4f1f945d9 | ||
|
54e6a6f172 | ||
|
2076093b93 | ||
|
5a8b86ffc3 | ||
|
c50767dbfe | ||
|
e1eecfc328 | ||
|
f0fa0c21ed | ||
|
dcdf5ddc8b | ||
|
31d3feb0ee | ||
|
9597f4c0a9 | ||
|
489eaccb26 | ||
|
df4a516dab | ||
|
e27e4b7140 | ||
|
d8522eea61 | ||
|
cf2e9edd2a | ||
|
8cb34fe1e5 | ||
|
859ffbd0d0 | ||
|
d30737529f | ||
|
e53cc4cb81 | ||
|
ce66f63638 | ||
|
fd82b38c08 | ||
|
a8209677e6 | ||
|
489a03aac4 | ||
|
d6f110ce1e | ||
|
db632c70f2 | ||
|
8380af7d49 | ||
|
377bddc67b | ||
|
f621c70917 | ||
|
4b44fa2951 | ||
|
c5a0e44f79 | ||
|
83dbf819fb | ||
|
cbe2833e9b | ||
|
5b29ffa40d | ||
|
c8f4fd4c5d | ||
|
c639d964e8 | ||
|
9c52277f7b | ||
|
8457ade3d7 | ||
|
bdb15640ef | ||
|
f559ed8889 | ||
|
db3e60d230 | ||
|
504181401b | ||
|
b0da6c009f | ||
|
c56c9818a0 | ||
|
1c794ced3b | ||
|
0b7411e2cf | ||
|
750c807fa1 | ||
|
ae34186caa | ||
|
a5d411bf28 | ||
|
2875e4112a | ||
|
9d27fac8dc | ||
|
7501463241 | ||
|
b9cccec41e | ||
|
e782e1d323 | ||
|
c12a4b1908 | ||
|
dd1933a7b4 | ||
|
08093066ac | ||
|
c603e10bc1 | ||
|
5fe58fddba | ||
|
54a4434749 | ||
|
20d80bcd8c | ||
|
d9f616f4a2 | ||
|
e76c874d85 | ||
|
029c1a08f9 | ||
|
eafac7a3ef | ||
|
e4462d9bb6 | ||
|
91e6658ef0 | ||
|
714f710922 | ||
|
813be0645e | ||
|
a580dd75ed | ||
|
cf30185743 | ||
|
f815420c17 | ||
|
e5aa21b8a8 | ||
|
d2178821cb | ||
|
6462e1bf5e | ||
|
051ddfc79a | ||
|
f191fb8187 | ||
|
6cb5962c01 | ||
|
33b82d2be0 | ||
|
a2c82a8833 | ||
|
286809f3da | ||
|
5e3936a404 | ||
|
f97b3d256e | ||
|
7b01d765e7 | ||
|
4976317340 | ||
|
28e7732e93 | ||
|
390b063535 | ||
|
50bcf7b81d | ||
|
1511f85feb | ||
|
db7681db4d | ||
|
eda4527add | ||
|
0ab035e1c1 | ||
|
af61d81606 | ||
|
86114bb2c7 | ||
|
1139364d4c | ||
|
e3404eb04b | ||
|
c1bc06c3e6 | ||
|
8632feabc7 | ||
|
7d421d3e4c | ||
|
95d87cfaa5 | ||
|
cfc119fff7 | ||
|
4b0ac9453b | ||
|
b7c9581509 | ||
|
fd97637134 | ||
|
f69bcb9ae8 | ||
|
f1ebad9abb | ||
|
63cdebd96b | ||
|
4f693f0ddb | ||
|
1828d864ae | ||
|
dbc1ba3666 | ||
|
df5698c4aa | ||
|
9614091a5e | ||
|
98e0f6025c | ||
|
8dd38bec4d | ||
|
ddf2c5b9f1 | ||
|
d8356e3cf1 | ||
|
fb15409be9 | ||
|
9f90987bad | ||
|
596c2d5548 | ||
|
b6bc5040aa | ||
|
6fcf128c18 | ||
|
bf8dc2ce19 | ||
|
abd7ea550b | ||
|
ab7b255432 | ||
|
8af9b8c0d5 | ||
|
a07d7115c5 | ||
|
20e19cf1eb | ||
|
da14e08646 | ||
|
046c703d6d | ||
|
ab371259dd | ||
|
711b0ed1cd | ||
|
e5063fa6dd | ||
|
58be994809 | ||
|
6d889ad7e9 | ||
|
37ce049d08 | ||
|
32a0227f7c | ||
|
c742786fc9 | ||
|
7f9aba2ea8 | ||
|
d48d5de82e | ||
|
78d67e4cbe | ||
|
7c0ae727e6 | ||
|
af6a5970d8 | ||
|
3789ef4a0a | ||
|
42a3ae6a38 | ||
|
a93c85ca96 | ||
|
ed5a99d637 | ||
|
45a2a58fb0 | ||
|
042b824d8b | ||
|
ca2c254157 | ||
|
3ed76c92c6 | ||
|
e26a05e473 | ||
|
d59e15bbd0 | ||
|
3e53047dc0 | ||
|
339315a4b0 | ||
|
f5eb08fafc | ||
|
c276f65cf9 | ||
|
9dddc3350f | ||
|
0a1633ac31 | ||
|
164addf07d | ||
|
fbff0cd1e0 | ||
|
9597ab97de | ||
|
014420965c | ||
|
87399813a5 | ||
|
2ea85f7322 | ||
|
e31acce9d3 | ||
|
25deb782d0 | ||
|
0e2b180da6 | ||
|
1b904544aa | ||
|
85823c67e1 | ||
|
3183d3481b | ||
|
2be10a7999 | ||
|
9f0d4d44b9 | ||
|
669db9c5d1 | ||
|
75680dae34 | ||
|
465b328f75 | ||
|
7c4605913c | ||
|
618acc18f3 | ||
|
36c6bd42bd | ||
|
bb022f3294 | ||
|
1a3f0fd0f6 | ||
|
4933c8ef88 | ||
|
ecd8e7bc48 | ||
|
04cd6de8fd | ||
|
8019d941f3 | ||
|
cf8d655310 | ||
|
6cf4da4de2 | ||
|
148a6573c6 | ||
|
0294e8c526 | ||
|
2a787f0182 | ||
|
62dcd84517 | ||
|
7c5e9bef11 | ||
|
3f58382eea | ||
|
c50f9fd17d | ||
|
1ee7d6e98a | ||
|
e2a54ec0b9 | ||
|
9794f98ff1 | ||
|
ba0b7df03e | ||
|
87a781f6ce | ||
|
6fa13fefb3 | ||
|
efb69e1873 | ||
|
9d932c08b7 | ||
|
53c9fb0da1 | ||
|
d6bd6182f2 | ||
|
01fdaf2f02 | ||
|
75c03d0413 | ||
|
ade70d3851 | ||
|
abaaadb545 | ||
|
4f06df820b | ||
|
ff31e77830 | ||
|
81f05c5524 | ||
|
60edcea535 | ||
|
2fa0a59e21 | ||
|
d1f987783c | ||
|
0466bfb243 |
@ -1,9 +0,0 @@
|
||||
version: 1
|
||||
update_configs:
|
||||
- package_manager: "javascript"
|
||||
directory: "/"
|
||||
update_schedule: "daily"
|
||||
default_labels:
|
||||
- "dependencies"
|
||||
commit_message:
|
||||
prefix: "deps"
|
35
.devcontainer/devcontainer.json
Normal file
35
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "Node.js",
|
||||
"image": "docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest",
|
||||
|
||||
// Use 'settings' to set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created in the array below.
|
||||
"extensions": [
|
||||
"bungcip.better-toml",
|
||||
"EditorConfig.EditorConfig",
|
||||
"donjayamanne.githistory",
|
||||
"eamodio.gitlens",
|
||||
"oderwat.indent-rainbow",
|
||||
"yzhang.markdown-all-in-one",
|
||||
"shd101wyy.markdown-preview-enhanced",
|
||||
"christian-kohler.path-intellisense",
|
||||
"lfs.vscode-emacs-friendly",
|
||||
"ms-azuretools.vscode-docker",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"firsttris.vscode-jest-runner",
|
||||
"VisualStudioExptTeam.vscodeintellicode"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [3000],
|
||||
|
||||
// Specifies a command that should be run after the container has been created.
|
||||
"postCreateCommand": "npm ci",
|
||||
|
||||
// Comment out the next line to run as root instead.
|
||||
// "remoteUser": "runner"
|
||||
}
|
@ -6,10 +6,12 @@
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jest/recommended"
|
||||
"plugin:jest/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"globals": {
|
||||
"Atomics": "readonly",
|
||||
"SharedArrayBuffer": "readonly"
|
||||
|
52
.github/ISSUE_TEMPLATE/1_user_support.yml
vendored
Normal file
52
.github/ISSUE_TEMPLATE/1_user_support.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
name: User Support
|
||||
description: Questions for this action
|
||||
title: "support: "
|
||||
labels: support
|
||||
assignees: peaceiris
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value:
|
||||
Please note we will close your issue without comment if you do not fill out the issue checklist below and provide ALL the requested information.
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Checklist
|
||||
description: Checklist before creating an issue.
|
||||
options:
|
||||
- label: "I am using the latest version of this action."
|
||||
required: true
|
||||
- label: "I have read the latest README and followed the instructions."
|
||||
required: true
|
||||
- label: "I have read the latest GitHub Actions official documentation and learned the basic spec and concepts."
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe your question
|
||||
description: A clear and concise description of what the question is.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Relevant links
|
||||
description:
|
||||
Links to your public repository, YAML config file, and YAML workflow file.
|
||||
Please use [a permanent link](https://docs.github.com/en/github/managing-files-in-a-repository/managing-files-on-github/getting-permanent-links-to-files), not a default branch.
|
||||
render: markdown
|
||||
value: |
|
||||
Public repository:
|
||||
YAML config:
|
||||
YAML workflow:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: Copy and paste any relevant log output here.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context.
|
||||
description: Write any other context about the question here.
|
||||
validations:
|
||||
required: false
|
52
.github/ISSUE_TEMPLATE/2_bug_report.txt
vendored
Normal file
52
.github/ISSUE_TEMPLATE/2_bug_report.txt
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
name: Bug Report
|
||||
description: Try the User Support Issue Template first.
|
||||
title: 'bug: '
|
||||
labels: bug
|
||||
assignees: peaceiris
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value:
|
||||
Please note we will close your issue without comment if you do not fill out the issue checklist below and provide ALL the requested information.
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Checklist
|
||||
description: Checklist before creating an issue.
|
||||
options:
|
||||
- label: "I am using the latest version of this action."
|
||||
required: true
|
||||
- label: "I have read the latest README and followed the instructions."
|
||||
required: true
|
||||
- label: "I have read the latest GitHub Actions official documentation and learned the basic spec and concepts."
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Describe the bug"
|
||||
description: "A clear and concise description of what the bug is."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Relevant links
|
||||
description:
|
||||
Links to your public repository, YAML config file, and YAML workflow file.
|
||||
Please use [a permanent link](https://docs.github.com/en/github/managing-files-in-a-repository/managing-files-on-github/getting-permanent-links-to-files), not a default branch.
|
||||
render: markdown
|
||||
value: |
|
||||
Public repository:
|
||||
YAML config:
|
||||
YAML workflow:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: Copy and paste any relevant log output here.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context.
|
||||
description: Write any other context about the question here.
|
||||
validations:
|
||||
required: false
|
45
.github/ISSUE_TEMPLATE/3_proposal.yml
vendored
Normal file
45
.github/ISSUE_TEMPLATE/3_proposal.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: Proposal
|
||||
description: Suggest an idea for this project
|
||||
title: 'proposal: '
|
||||
labels: proposal
|
||||
assignees: peaceiris
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value:
|
||||
Please note we will close your issue without comment if you do not fill out the issue checklist below and provide ALL the requested information.
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Checklist
|
||||
description: Checklist before creating an issue.
|
||||
options:
|
||||
- label: "I am using the latest version of this action."
|
||||
required: true
|
||||
- label: "I have read the latest README and followed the instructions."
|
||||
required: true
|
||||
- label: "I have read the latest GitHub Actions official documentation and learned the basic spec and concepts."
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Describe your proposal"
|
||||
description: "A clear and concise description of what the proposal is."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Describe the solution you'd like"
|
||||
description: "A clear and concise description of what you want to happen."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Describe alternatives you've considered"
|
||||
description: "A clear and concise description of any alternative solutions or features you've considered."
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Additional context"
|
||||
description: "Add any other context or screenshots about the feature request here."
|
||||
validations:
|
||||
required: false
|
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,31 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: 'sample_title'
|
||||
labels: bug
|
||||
assignees: peaceiris
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Your YAML file**
|
||||
- A link to your repository
|
||||
- A link to your YAML file
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
15
.github/ISSUE_TEMPLATE/config.yml
vendored
15
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,11 +1,14 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: GitHub Actions Community Forum
|
||||
url: https://github.community/t5/GitHub-Actions/bd-p/actions
|
||||
- name: Discussions
|
||||
url: https://github.com/peaceiris/actions-gh-pages/discussions
|
||||
about: Ask casual questions or share your story about the GitHub Pages Action.
|
||||
- name: GitHub Actions - GitHub Support Community Forum
|
||||
url: https://github.community/c/code-to-cloud/github-actions/41
|
||||
about: Please ask questions about GitHub Actions here.
|
||||
- name: GitHub Pages Documentation
|
||||
url: https://help.github.com/en/github/working-with-github-pages
|
||||
about: GitHub Pages official documentaion here.
|
||||
url: https://docs.github.com/en/pages
|
||||
about: GitHub Pages official documentation here.
|
||||
- name: GitHub Actions Documentation
|
||||
url: https://help.github.com/en/actions
|
||||
about: GitHub Actions official documentaion here.
|
||||
url: https://docs.github.com/en/actions
|
||||
about: GitHub Actions official documentation here.
|
||||
|
20
.github/ISSUE_TEMPLATE/proposal.md
vendored
20
.github/ISSUE_TEMPLATE/proposal.md
vendored
@ -1,20 +0,0 @@
|
||||
---
|
||||
name: Proposal
|
||||
about: Suggest an idea for this project
|
||||
title: 'sample_title'
|
||||
labels: proposal
|
||||
assignees: peaceiris
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
31
.github/ISSUE_TEMPLATE/user_support.md
vendored
31
.github/ISSUE_TEMPLATE/user_support.md
vendored
@ -1,31 +0,0 @@
|
||||
---
|
||||
name: User support
|
||||
about: Questions for this action
|
||||
title: 'sample_title'
|
||||
labels: support
|
||||
assignees: peaceiris
|
||||
---
|
||||
|
||||
**Check list before opening this issue**
|
||||
|
||||
- [ ] I read the latest README
|
||||
- I checked [Available Options](https://github.com/peaceiris/actions-gh-pages#options)
|
||||
- I followed [Tips and FAQ](https://github.com/peaceiris/actions-gh-pages#tips-and-faq)
|
||||
- I tried [Workflow Examples](https://github.com/peaceiris/actions-gh-pages#examples)
|
||||
|
||||
**Describe your question**
|
||||
|
||||
A clear and concise description of what the question is.
|
||||
|
||||
**Link to your contents**
|
||||
|
||||
- Link to your public repository here
|
||||
- Link to your workflow here
|
||||
|
||||
**Screenshots**
|
||||
|
||||
If applicable, add screenshots to help explain your question.
|
||||
|
||||
**Additional context**
|
||||
|
||||
Add any other context about the problem here.
|
36
.github/label-commenter-config.yml
vendored
Normal file
36
.github/label-commenter-config.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
labels:
|
||||
- name: resolved
|
||||
labeled:
|
||||
issue:
|
||||
body: |
|
||||
This issue has been **LOCKED** because of it being resolved!
|
||||
|
||||
The issue has been fixed and is therefore considered resolved.
|
||||
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.
|
||||
action: close
|
||||
locking: lock
|
||||
lock_reason: resolved
|
||||
- name: inactive
|
||||
labeled:
|
||||
issue:
|
||||
body: |
|
||||
This issue has been marked as inactive.
|
||||
|
||||
If you still encounter this or it has changed, add a comment to provide further information.
|
||||
- name: stale
|
||||
labeled:
|
||||
issue:
|
||||
body: |
|
||||
This issue has been **LOCKED** because of it being old.
|
||||
If you still encounter this or it has changed, open a new issue.
|
||||
action: close
|
||||
locking: lock
|
||||
lock_reason: resolved
|
||||
- name: duplicate
|
||||
labeled:
|
||||
issue:
|
||||
body: |
|
||||
This issue has been closed because of duplication.
|
||||
action: close
|
||||
locking: lock
|
||||
lock_reason: resolved
|
20
.github/labeler.yml
vendored
Normal file
20
.github/labeler.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
cicd:
|
||||
- .github/workflows/*
|
||||
|
||||
dependencies:
|
||||
- .nvmrc
|
||||
- package.json
|
||||
- package-lock.json
|
||||
|
||||
documentation:
|
||||
- README.md
|
||||
|
||||
test:
|
||||
- __tests__
|
||||
|
||||
docker:
|
||||
- .devcontainer/*
|
||||
- .dockerignore
|
||||
- Dockerfile
|
||||
- Makefile
|
||||
- docker-compose.yml
|
24
.github/workflows/codeql.yml
vendored
Normal file
24
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: "Code Scanning"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
16
.github/workflows/dependency-review.yml
vendored
Normal file
16
.github/workflows/dependency-review.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
# Source repository: https://github.com/actions/dependency-review-action
|
||||
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
|
||||
name: 'Dependency Review'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/dependency-review-action@v4
|
27
.github/workflows/label-commenter.yml
vendored
Normal file
27
.github/workflows/label-commenter.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: Label Commenter
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
- unlabeled
|
||||
pull_request_target:
|
||||
types:
|
||||
- labeled
|
||||
- unlabeled
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Label Commenter
|
||||
uses: peaceiris/actions-label-commenter@v1
|
||||
env:
|
||||
RUNNER_DEBUG: 1
|
22
.github/workflows/labeler.yml
vendored
Normal file
22
.github/workflows/labeler.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
name: "Pull Request Labeler"
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 1
|
||||
permissions: {}
|
||||
steps:
|
||||
# https://github.com/peaceiris/actions-github-app-token
|
||||
- uses: peaceiris/actions-github-app-token@v1.1.6
|
||||
id: app
|
||||
with:
|
||||
app_id: ${{ secrets.GH_APP_ID }}
|
||||
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
||||
|
||||
# https://github.com/actions/labeler
|
||||
- uses: actions/labeler@v4
|
||||
with:
|
||||
repo-token: "${{ steps.app.outputs.token }}"
|
2
.github/workflows/pages-status-check.yml
vendored
2
.github/workflows/pages-status-check.yml
vendored
@ -4,7 +4,7 @@ on: page_build
|
||||
|
||||
jobs:
|
||||
pages-status-check:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: check status
|
||||
run: |
|
||||
|
@ -3,10 +3,11 @@ name: Purge image cache
|
||||
on:
|
||||
schedule:
|
||||
- cron: '54 18 * * */7'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
purge:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
|
||||
- run: >
|
||||
|
28
.github/workflows/release.yml
vendored
28
.github/workflows/release.yml
vendored
@ -7,30 +7,10 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: echo "${GITHUB_CONTEXT}"
|
||||
|
||||
- name: Install github/hub
|
||||
run: |
|
||||
export HUB_VERSION="2.14.2"
|
||||
curl -fsSL https://github.com/github/hub/raw/8d91904208171b013f9a9d1175f4ab39068db047/script/get | bash -s "${HUB_VERSION}"
|
||||
|
||||
- name: Create release
|
||||
- uses: actions/checkout@v4
|
||||
# https://github.com/peaceiris/workflows/blob/main/create-release-npm/action.yml
|
||||
- uses: peaceiris/workflows/create-release-npm@v0.20.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
TAG_NAME="${GITHUB_REF##refs/tags/}"
|
||||
echo "See [CHANGELOG.md](https://github.com/${GITHUB_REPOSITORY}/blob/${TAG_NAME}/CHANGELOG.md) for more details." > ./release_notes.md
|
||||
RELEASE_NAME="$(jq -r '.name' ./package.json)"
|
||||
sed -i "1i${RELEASE_NAME} ${TAG_NAME}\n" ./release_notes.md
|
||||
./bin/hub release create \
|
||||
--draft \
|
||||
--prerelease \
|
||||
--file ./release_notes.md \
|
||||
"${TAG_NAME}"
|
||||
|
17
.github/workflows/stale.yml
vendored
17
.github/workflows/stale.yml
vendored
@ -1,17 +0,0 @@
|
||||
name: "Stale"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "6 6 * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/stale@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
stale-pr-message: 'This pull request is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||
days-before-stale: 21
|
||||
days-before-close: 7
|
113
.github/workflows/test-action.yml
vendored
113
.github/workflows/test-action.yml
vendored
@ -1,113 +0,0 @@
|
||||
name: Test Action
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
|
||||
jobs:
|
||||
skipci:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
|
||||
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
os:
|
||||
- 'ubuntu-18.04'
|
||||
- 'macos-latest'
|
||||
- 'windows-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Read .nvmrc
|
||||
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
|
||||
id: nvm
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
||||
|
||||
- run: npm i -g npm
|
||||
|
||||
- name: Dump version
|
||||
run: |
|
||||
node -v
|
||||
npm --version
|
||||
git --version
|
||||
|
||||
- run: npm ci
|
||||
|
||||
- name: Remove lint-staged husky
|
||||
run: |
|
||||
npm uninstall lint-staged husky
|
||||
git checkout package-lock.json package.json
|
||||
|
||||
- run: npm run build
|
||||
|
||||
- name: Setup mdBook
|
||||
uses: peaceiris/actions-mdbook@v1
|
||||
with:
|
||||
mdbook-version: '0.3.5'
|
||||
|
||||
- name: Build
|
||||
working-directory: ./test_projects/mdbook
|
||||
run: mdbook build
|
||||
|
||||
- name: Prepare tag
|
||||
id: prepare_tag
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
TAG_NAME="${GITHUB_REF##refs/tags/}"
|
||||
echo "::set-output name=tag_name::${TAG_NAME}"
|
||||
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}"
|
||||
|
||||
- name: Deploy
|
||||
if: matrix.os != 'windows-latest'
|
||||
uses: ./
|
||||
with:
|
||||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# publish_branch: gh-pages
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
# keep_files: true
|
||||
# force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
# tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
|
||||
# tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'
|
||||
|
||||
- name: Deploy
|
||||
if: matrix.os == 'windows-latest'
|
||||
uses: ./
|
||||
with:
|
||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# personal_token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
# publish_branch: gh-pages
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
# keep_files: true
|
||||
# force_orphan: true
|
||||
# user_name: iris
|
||||
# user_email: email@peaceiris.com
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
# tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
|
||||
# tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'
|
171
.github/workflows/test.yml
vendored
171
.github/workflows/test.yml
vendored
@ -3,44 +3,35 @@ name: 'Test'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
|
||||
jobs:
|
||||
skipci:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- 'ubuntu-18.04'
|
||||
- 'ubuntu-22.04'
|
||||
- 'ubuntu-20.04'
|
||||
- 'ubuntu-latest'
|
||||
- 'macos-latest'
|
||||
- 'windows-latest'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Read .nvmrc
|
||||
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
|
||||
id: nvm
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
- uses: peaceiris/workflows/setup-node@v0.20.1
|
||||
with:
|
||||
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
||||
|
||||
- run: npm i -g npm
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Dump version
|
||||
run: |
|
||||
@ -48,28 +39,144 @@ jobs:
|
||||
npm --version
|
||||
git --version
|
||||
|
||||
- run: npm ci
|
||||
- run: npm ci --ignore-scripts
|
||||
|
||||
- name: npm audit
|
||||
if: startsWith(matrix.os, 'ubuntu-22.04')
|
||||
run: |
|
||||
npm audit > ./audit.log || true
|
||||
if ! [ "$(cat ./audit.log | wc -l)" = 1 ]; then
|
||||
echo "::warning::$(cat ./audit.log)"
|
||||
fi
|
||||
rm ./audit.log
|
||||
|
||||
- name: Run prettier
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
if: startsWith(matrix.os, 'ubuntu-22.04')
|
||||
run: npm run format:check
|
||||
|
||||
- name: Run eslint
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
if: startsWith(matrix.os, 'ubuntu-22.04')
|
||||
run: npm run lint
|
||||
|
||||
- name: Run ncc
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
run: npm run build
|
||||
|
||||
- run: npm test
|
||||
|
||||
- name: Upload test coverage as artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage
|
||||
name: coverage-${{ matrix.os }}
|
||||
path: coverage
|
||||
|
||||
- uses: codecov/codecov-action@v1
|
||||
- uses: codecov/codecov-action@v4
|
||||
|
||||
- name: Run ncc
|
||||
run: npm run build
|
||||
|
||||
- name: Remove lint-staged husky
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
run: |
|
||||
npm uninstall lint-staged husky
|
||||
git checkout package-lock.json package.json
|
||||
|
||||
- name: Setup mdBook
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
uses: peaceiris/actions-mdbook@v1.2.0
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
mdbook-version: '0.4.5'
|
||||
|
||||
- name: Build site
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
working-directory: ./test_projects/mdbook
|
||||
run: mdbook build
|
||||
|
||||
- name: Deploy
|
||||
if: |
|
||||
startsWith(matrix.os, 'ubuntu-latest') &&
|
||||
github.ref == 'refs/heads/main' && github.event.repository.fork == false
|
||||
uses: ./
|
||||
with:
|
||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# publish_branch: gh-pages
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
# keep_files: true
|
||||
# force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
cname: 'actions-gh-pages.peaceiris.com'
|
||||
|
||||
- name: Deploy
|
||||
if: |
|
||||
startsWith(matrix.os, 'macos') &&
|
||||
github.ref == 'refs/heads/main' && github.event.repository.fork == false
|
||||
uses: ./
|
||||
with:
|
||||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# personal_token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
publish_branch: gh-pages-macos
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
# keep_files: true
|
||||
# force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
|
||||
- name: Deploy
|
||||
if: |
|
||||
startsWith(matrix.os, 'windows') &&
|
||||
github.ref == 'refs/heads/main' && github.event.repository.fork == false
|
||||
uses: ./
|
||||
with:
|
||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# personal_token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
publish_branch: gh-pages-windows
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
# keep_files: true
|
||||
# force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
|
||||
- name: Deploy
|
||||
if: |
|
||||
startsWith(matrix.os, 'ubuntu-20.04') &&
|
||||
github.ref == 'refs/heads/main' && github.event.repository.fork == false
|
||||
uses: ./
|
||||
with:
|
||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: gh-pages-ubuntu-20.04
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
# keep_files: true
|
||||
# force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
|
||||
- name: Deploy
|
||||
if: |
|
||||
startsWith(matrix.os, 'ubuntu-22.04') &&
|
||||
github.ref == 'refs/heads/main' && github.event.repository.fork == false
|
||||
uses: ./
|
||||
with:
|
||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: gh-pages-ubuntu-22.04
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
# keep_files: true
|
||||
# force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
|
9
.github/workflows/update-major-tag.yml
vendored
9
.github/workflows/update-major-tag.yml
vendored
@ -2,17 +2,16 @@ name: Update major tag
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
types: [released]
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 1
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Update major tag
|
||||
if: github.event.release.prerelease == false
|
||||
run: |
|
||||
git config user.name "${GITHUB_ACTOR}"
|
||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||
|
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
_
|
2
.husky/post-merge
Executable file
2
.husky/post-merge
Executable file
@ -0,0 +1,2 @@
|
||||
npm install
|
||||
git remote prune origin
|
1
.husky/pre-commit
Executable file
1
.husky/pre-commit
Executable file
@ -0,0 +1 @@
|
||||
npx lint-staged
|
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
lib/
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"printWidth": 80,
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
|
1
.vscode/.gitignore
vendored
Normal file
1
.vscode/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.log
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,3 +1,4 @@
|
||||
{
|
||||
"git.ignoreLimitWarning": true
|
||||
"git.ignoreLimitWarning": true,
|
||||
"deno.enable": false
|
||||
}
|
1109
CHANGELOG.md
1109
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
31
Dockerfile
31
Dockerfile
@ -1,31 +0,0 @@
|
||||
ARG NODE_VERSION
|
||||
|
||||
FROM node:${NODE_VERSION}-buster-slim
|
||||
|
||||
SHELL ["/bin/bash", "-l", "-c"]
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev autoconf \
|
||||
ca-certificates \
|
||||
wget \
|
||||
ssh \
|
||||
vim && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
npm i -g npm
|
||||
|
||||
WORKDIR /git
|
||||
ENV GIT_VERSION="2.25.1"
|
||||
RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \
|
||||
tar -zxf "./v${GIT_VERSION}.tar.gz" && \
|
||||
rm "./v${GIT_VERSION}.tar.gz" && \
|
||||
cd "./git-${GIT_VERSION}" && \
|
||||
make configure && \
|
||||
./configure --prefix=/usr && \
|
||||
make all && \
|
||||
make install
|
||||
|
||||
WORKDIR /repo
|
||||
|
||||
CMD [ "bash" ]
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Shohei Ueda (peaceiris)
|
||||
Copyright (c) 2019 Shohei Ueda (peaceiris)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
23
Makefile
23
Makefile
@ -1,23 +0,0 @@
|
||||
cmd := "bash"
|
||||
msg := ""
|
||||
IMAGE_NAME := actions_github_pages_dev:latest
|
||||
NODE_VERSION := $(shell cat ./.nvmrc)
|
||||
DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --build-arg NODE_VERSION=$(NODE_VERSION)
|
||||
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME)
|
||||
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
$(DOCKER_BUILD)
|
||||
|
||||
.PHONY: run
|
||||
run:
|
||||
$(DOCKER_RUN) $(cmd)
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
$(DOCKER_RUN) npm test
|
||||
|
||||
.PHONY: commit
|
||||
commit:
|
||||
$(DOCKER_RUN) git commit -m "$(msg)"
|
1
__tests__/fixtures/publish_dir_1/assets/lib.css
Normal file
1
__tests__/fixtures/publish_dir_1/assets/lib.css
Normal file
@ -0,0 +1 @@
|
||||
/* CSS */
|
1
__tests__/fixtures/publish_dir_1/assets/lib.js
Normal file
1
__tests__/fixtures/publish_dir_1/assets/lib.js
Normal file
@ -0,0 +1 @@
|
||||
// JavaScript
|
11
__tests__/fixtures/publish_dir_1/index.html
Normal file
11
__tests__/fixtures/publish_dir_1/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
1
__tests__/fixtures/publish_dir_1/main.css
Normal file
1
__tests__/fixtures/publish_dir_1/main.css
Normal file
@ -0,0 +1 @@
|
||||
/* CSS */
|
1
__tests__/fixtures/publish_dir_1/main.js
Normal file
1
__tests__/fixtures/publish_dir_1/main.js
Normal file
@ -0,0 +1 @@
|
||||
// JavaScript
|
1
__tests__/fixtures/publish_dir_root/.github/CODEOWNERS
vendored
Normal file
1
__tests__/fixtures/publish_dir_root/.github/CODEOWNERS
vendored
Normal file
@ -0,0 +1 @@
|
||||
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
|
1
__tests__/fixtures/publish_dir_root/.github/ISSUE_TEMPLATE/template.md
vendored
Normal file
1
__tests__/fixtures/publish_dir_root/.github/ISSUE_TEMPLATE/template.md
vendored
Normal file
@ -0,0 +1 @@
|
||||
<!-- issue template -->
|
7
__tests__/fixtures/publish_dir_root/.github/dependabot.yml
vendored
Normal file
7
__tests__/fixtures/publish_dir_root/.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
# dependabot config
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
1
__tests__/fixtures/publish_dir_root/.github/workflows/test.yml
vendored
Normal file
1
__tests__/fixtures/publish_dir_root/.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
name: 'Test'
|
1
__tests__/fixtures/publish_dir_root/assets/lib.css
Normal file
1
__tests__/fixtures/publish_dir_root/assets/lib.css
Normal file
@ -0,0 +1 @@
|
||||
/* CSS */
|
1
__tests__/fixtures/publish_dir_root/assets/lib.js
Normal file
1
__tests__/fixtures/publish_dir_root/assets/lib.js
Normal file
@ -0,0 +1 @@
|
||||
// JavaScript
|
11
__tests__/fixtures/publish_dir_root/index.html
Normal file
11
__tests__/fixtures/publish_dir_root/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
1
__tests__/fixtures/publish_dir_root/main.css
Normal file
1
__tests__/fixtures/publish_dir_root/main.css
Normal file
@ -0,0 +1 @@
|
||||
/* CSS */
|
1
__tests__/fixtures/publish_dir_root/main.js
Normal file
1
__tests__/fixtures/publish_dir_root/main.js
Normal file
@ -0,0 +1 @@
|
||||
// JavaScript
|
@ -9,9 +9,8 @@ beforeEach(() => {
|
||||
jest.resetModules();
|
||||
process.stdout.write = jest.fn();
|
||||
|
||||
const doc = yaml.safeLoad(
|
||||
fs.readFileSync(__dirname + '/../action.yml', 'utf8')
|
||||
);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const doc: any = yaml.load(fs.readFileSync(__dirname + '/../action.yml', 'utf8'));
|
||||
Object.keys(doc.inputs).forEach(name => {
|
||||
const envVar = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||
process.env[envVar] = doc.inputs[name]['default'];
|
||||
@ -19,9 +18,8 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
const doc = yaml.safeLoad(
|
||||
fs.readFileSync(__dirname + '/../action.yml', 'utf8')
|
||||
);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const doc: any = yaml.load(fs.readFileSync(__dirname + '/../action.yml', 'utf8'));
|
||||
Object.keys(doc.inputs).forEach(name => {
|
||||
const envVar = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||
console.debug(`delete ${envVar}\t${process.env[envVar]}`);
|
||||
@ -44,6 +42,7 @@ function getInputsLog(authMethod: string, inps: Inputs): string {
|
||||
[INFO] ${authMethod}: true
|
||||
[INFO] PublishBranch: ${inps.PublishBranch}
|
||||
[INFO] PublishDir: ${inps.PublishDir}
|
||||
[INFO] DestinationDir: ${inps.DestinationDir}
|
||||
[INFO] ExternalRepository: ${inps.ExternalRepository}
|
||||
[INFO] AllowEmptyCommit: ${inps.AllowEmptyCommit}
|
||||
[INFO] KeepFiles: ${inps.KeepFiles}
|
||||
@ -51,10 +50,12 @@ function getInputsLog(authMethod: string, inps: Inputs): string {
|
||||
[INFO] UserName: ${inps.UserName}
|
||||
[INFO] UserEmail: ${inps.UserEmail}
|
||||
[INFO] CommitMessage: ${inps.CommitMessage}
|
||||
[INFO] FullCommitMessage: ${inps.FullCommitMessage}
|
||||
[INFO] TagName: ${inps.TagName}
|
||||
[INFO] TagMessage: ${inps.TagMessage}
|
||||
[INFO] EnableJekyll (DisableNoJekyll): ${inps.DisableNoJekyll}
|
||||
[INFO] CNAME: ${inps.CNAME}
|
||||
[INFO] ExcludeAssets ${inps.ExcludeAssets}
|
||||
`;
|
||||
}
|
||||
|
||||
@ -110,6 +111,7 @@ describe('getInputs()', () => {
|
||||
expect(inps.PersonalToken).toMatch('');
|
||||
expect(inps.PublishBranch).toMatch('gh-pages');
|
||||
expect(inps.PublishDir).toMatch('public');
|
||||
expect(inps.DestinationDir).toMatch('');
|
||||
expect(inps.ExternalRepository).toMatch('');
|
||||
expect(inps.AllowEmptyCommit).toBe(false);
|
||||
expect(inps.KeepFiles).toBe(false);
|
||||
@ -117,10 +119,12 @@ describe('getInputs()', () => {
|
||||
expect(inps.UserName).toMatch('');
|
||||
expect(inps.UserEmail).toMatch('');
|
||||
expect(inps.CommitMessage).toMatch('');
|
||||
expect(inps.FullCommitMessage).toMatch('');
|
||||
expect(inps.TagName).toMatch('');
|
||||
expect(inps.TagMessage).toMatch('');
|
||||
expect(inps.DisableNoJekyll).toBe(false);
|
||||
expect(inps.CNAME).toMatch('');
|
||||
expect(inps.ExcludeAssets).toMatch('.github');
|
||||
});
|
||||
|
||||
test('get spec inputs', () => {
|
||||
@ -129,6 +133,7 @@ describe('getInputs()', () => {
|
||||
process.env['INPUT_PERSONAL_TOKEN'] = 'test_personal_token';
|
||||
process.env['INPUT_PUBLISH_BRANCH'] = 'master';
|
||||
process.env['INPUT_PUBLISH_DIR'] = 'out';
|
||||
process.env['INPUT_DESTINATION_DIR'] = 'subdir';
|
||||
process.env['INPUT_EXTERNAL_REPOSITORY'] = 'user/repo';
|
||||
process.env['INPUT_ALLOW_EMPTY_COMMIT'] = 'true';
|
||||
process.env['INPUT_KEEP_FILES'] = 'true';
|
||||
@ -136,10 +141,12 @@ describe('getInputs()', () => {
|
||||
process.env['INPUT_USER_NAME'] = 'username';
|
||||
process.env['INPUT_USER_EMAIL'] = 'github@github.com';
|
||||
process.env['INPUT_COMMIT_MESSAGE'] = 'feat: Add new feature';
|
||||
process.env['INPUT_FULL_COMMIT_MESSAGE'] = 'feat: Add new feature';
|
||||
process.env['INPUT_TAG_NAME'] = 'deploy-v1.2.3';
|
||||
process.env['INPUT_TAG_MESSAGE'] = 'Deployment v1.2.3';
|
||||
process.env['INPUT_DISABLE_NOJEKYLL'] = 'true';
|
||||
process.env['INPUT_CNAME'] = 'github.com';
|
||||
process.env['INPUT_EXCLUDE_ASSETS'] = '.github';
|
||||
|
||||
const inps: Inputs = getInputs();
|
||||
|
||||
@ -148,6 +155,7 @@ describe('getInputs()', () => {
|
||||
expect(inps.PersonalToken).toMatch('test_personal_token');
|
||||
expect(inps.PublishBranch).toMatch('master');
|
||||
expect(inps.PublishDir).toMatch('out');
|
||||
expect(inps.DestinationDir).toMatch('subdir');
|
||||
expect(inps.ExternalRepository).toMatch('user/repo');
|
||||
expect(inps.AllowEmptyCommit).toBe(true);
|
||||
expect(inps.KeepFiles).toBe(true);
|
||||
@ -155,10 +163,18 @@ describe('getInputs()', () => {
|
||||
expect(inps.UserName).toMatch('username');
|
||||
expect(inps.UserEmail).toMatch('github@github.com');
|
||||
expect(inps.CommitMessage).toMatch('feat: Add new feature');
|
||||
expect(inps.FullCommitMessage).toMatch('feat: Add new feature');
|
||||
expect(inps.TagName).toMatch('deploy-v1.2.3');
|
||||
expect(inps.TagMessage).toMatch('Deployment v1.2.3');
|
||||
expect(inps.DisableNoJekyll).toBe(true);
|
||||
expect(inps.CNAME).toMatch('github.com');
|
||||
expect(inps.ExcludeAssets).toMatch('.github');
|
||||
});
|
||||
|
||||
test('get spec inputs enable_jekyll', () => {
|
||||
process.env['INPUT_ENABLE_JEKYLL'] = 'true';
|
||||
const inps: Inputs = getInputs();
|
||||
expect(inps.DisableNoJekyll).toBe(true);
|
||||
});
|
||||
|
||||
test('throw error enable_jekyll or disable_nojekyll', () => {
|
||||
@ -168,6 +184,6 @@ describe('getInputs()', () => {
|
||||
|
||||
expect(() => {
|
||||
getInputs();
|
||||
}).toThrowError('Use either of enable_jekyll or disable_nojekyll');
|
||||
}).toThrow('Use either of enable_jekyll or disable_nojekyll');
|
||||
});
|
||||
});
|
||||
|
@ -1,7 +1,27 @@
|
||||
import {getUserName, getUserEmail, setCommitAuthor} from '../src/git-utils';
|
||||
import {getWorkDirName, createWorkDir} from '../src/utils';
|
||||
import {
|
||||
copyAssets,
|
||||
setRepo,
|
||||
getUserName,
|
||||
getUserEmail,
|
||||
setCommitAuthor,
|
||||
getCommitMessage
|
||||
} from '../src/git-utils';
|
||||
import {getInputs} from '../src/get-inputs';
|
||||
import {Inputs} from '../src/interfaces';
|
||||
import {getWorkDirName, createDir} from '../src/utils';
|
||||
import {CmdResult} from '../src/interfaces';
|
||||
import * as exec from '@actions/exec';
|
||||
import {cp, rm} from 'shelljs';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
|
||||
const testRoot = path.resolve(__dirname);
|
||||
|
||||
async function createTestDir(name: string): Promise<string> {
|
||||
const date = new Date();
|
||||
const unixTime = date.getTime();
|
||||
return await getWorkDirName(`${unixTime}_${name}`);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
@ -14,6 +34,126 @@ afterEach(() => {
|
||||
delete process.env['GITHUB_REPOSITORY'];
|
||||
});
|
||||
|
||||
describe('copyAssets', () => {
|
||||
let gitTempDir = '';
|
||||
(async (): Promise<void> => {
|
||||
const date = new Date();
|
||||
const unixTime = date.getTime();
|
||||
gitTempDir = await getWorkDirName(`${unixTime}_git`);
|
||||
})();
|
||||
|
||||
beforeAll(async () => {
|
||||
await createDir(gitTempDir);
|
||||
process.chdir(gitTempDir);
|
||||
await exec.exec('git', ['init']);
|
||||
});
|
||||
|
||||
test('copy assets from publish_dir to root, delete .github', async () => {
|
||||
const publishDir = await createTestDir('src');
|
||||
const destDir = await createTestDir('dst');
|
||||
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_1'), publishDir);
|
||||
cp('-Rf', gitTempDir, destDir);
|
||||
|
||||
await copyAssets(publishDir, destDir, '.github');
|
||||
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeFalsy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||
rm('-rf', publishDir, destDir);
|
||||
});
|
||||
|
||||
test('copy assets from publish_dir to root, delete .github,main.js', async () => {
|
||||
const publishDir = await createTestDir('src');
|
||||
const destDir = await createTestDir('dst');
|
||||
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_1'), publishDir);
|
||||
cp('-Rf', gitTempDir, destDir);
|
||||
|
||||
await copyAssets(publishDir, destDir, '.github,main.js');
|
||||
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeFalsy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'main.js'))).toBeFalsy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.js'))).toBeTruthy();
|
||||
rm('-rf', publishDir, destDir);
|
||||
});
|
||||
|
||||
test('copy assets from publish_dir to root, delete nothing', async () => {
|
||||
const publishDir = await createTestDir('src');
|
||||
const destDir = await createTestDir('dst');
|
||||
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_root'), publishDir);
|
||||
cp('-Rf', gitTempDir, destDir);
|
||||
|
||||
await copyAssets(publishDir, destDir, '');
|
||||
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'main.js'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.js'))).toBeTruthy();
|
||||
rm('-rf', publishDir, destDir);
|
||||
});
|
||||
|
||||
test('copy assets from root to root, delete .github', async () => {
|
||||
const publishDir = await createTestDir('src');
|
||||
const destDir = await createTestDir('dst');
|
||||
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_root'), publishDir);
|
||||
cp('-Rf', gitTempDir, destDir);
|
||||
cp('-Rf', gitTempDir, publishDir);
|
||||
|
||||
await copyAssets(publishDir, destDir, '.github');
|
||||
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeFalsy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||
rm('-rf', publishDir, destDir);
|
||||
});
|
||||
|
||||
test('copy assets from root to root, delete nothing', async () => {
|
||||
const publishDir = await createTestDir('src');
|
||||
const destDir = await createTestDir('dst');
|
||||
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_root'), publishDir);
|
||||
cp('-Rf', gitTempDir, destDir);
|
||||
cp('-Rf', gitTempDir, publishDir);
|
||||
|
||||
await copyAssets(publishDir, destDir, '');
|
||||
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||
rm('-rf', publishDir, destDir);
|
||||
});
|
||||
|
||||
test.todo('copy assets from root to subdir, delete .github');
|
||||
test.todo('copy assets from root to subdir, delete .github,main.js');
|
||||
test.todo('copy assets from root to subdir, delete nothing');
|
||||
});
|
||||
|
||||
describe('setRepo()', () => {
|
||||
test('throw error destination_dir should be a relative path', async () => {
|
||||
process.env['INPUT_GITHUB_TOKEN'] = 'test_github_token';
|
||||
process.env['INPUT_PUBLISH_BRANCH'] = 'gh-pages';
|
||||
process.env['INPUT_PUBLISH_DIR'] = 'public';
|
||||
process.env['INPUT_DESTINATION_DIR'] = '/subdir';
|
||||
// process.env['INPUT_EXTERNAL_REPOSITORY'] = 'user/repo';
|
||||
// process.env['INPUT_ALLOW_EMPTY_COMMIT'] = 'true';
|
||||
// process.env['INPUT_KEEP_FILES'] = 'true';
|
||||
// process.env['INPUT_FORCE_ORPHAN'] = 'true';
|
||||
// process.env['INPUT_USER_NAME'] = 'username';
|
||||
// process.env['INPUT_USER_EMAIL'] = 'github@github.com';
|
||||
// process.env['INPUT_COMMIT_MESSAGE'] = 'feat: Add new feature';
|
||||
// process.env['INPUT_FULL_COMMIT_MESSAGE'] = 'feat: Add new feature';
|
||||
// process.env['INPUT_TAG_NAME'] = 'deploy-v1.2.3';
|
||||
// process.env['INPUT_TAG_MESSAGE'] = 'Deployment v1.2.3';
|
||||
// process.env['INPUT_DISABLE_NOJEKYLL'] = 'true';
|
||||
// process.env['INPUT_CNAME'] = 'github.com';
|
||||
process.env['INPUT_EXCLUDE_ASSETS'] = '.github';
|
||||
const inps: Inputs = getInputs();
|
||||
const remoteURL = 'https://x-access-token:pat@github.com/actions/pages.git';
|
||||
const date = new Date();
|
||||
const unixTime = date.getTime();
|
||||
const workDir = await getWorkDirName(`${unixTime}`);
|
||||
await expect(setRepo(inps, remoteURL, workDir)).rejects.toThrow(
|
||||
'destination_dir should be a relative path'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getUserName()', () => {
|
||||
test('get default git user name', () => {
|
||||
const userName = '';
|
||||
@ -51,7 +191,7 @@ describe('setCommitAuthor()', () => {
|
||||
})();
|
||||
|
||||
beforeEach(async () => {
|
||||
await createWorkDir(workDirName);
|
||||
await createDir(workDirName);
|
||||
process.chdir(workDirName);
|
||||
await exec.exec('git', ['init']);
|
||||
});
|
||||
@ -101,16 +241,62 @@ describe('setCommitAuthor()', () => {
|
||||
test('throw error user_email is undefined', async () => {
|
||||
const userName = 'custom-octocat';
|
||||
const userEmail = '';
|
||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrowError(
|
||||
'user_email is undefined'
|
||||
);
|
||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrow('user_email is undefined');
|
||||
});
|
||||
|
||||
test('throw error user_name is undefined', async () => {
|
||||
const userName = '';
|
||||
const userEmail = 'custom-octocat@github.com';
|
||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrowError(
|
||||
'user_name is undefined'
|
||||
);
|
||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrow('user_name is undefined');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getCommitMessage()', () => {
|
||||
test('get default message', () => {
|
||||
const test = getCommitMessage('', '', '', 'actions/pages', 'commit_hash');
|
||||
expect(test).toMatch('deploy: commit_hash');
|
||||
});
|
||||
|
||||
test('get default message for external repository', () => {
|
||||
const test = getCommitMessage(
|
||||
'',
|
||||
'',
|
||||
'actions/actions.github.io',
|
||||
'actions/pages',
|
||||
'commit_hash'
|
||||
);
|
||||
expect(test).toMatch('deploy: actions/pages@commit_hash');
|
||||
});
|
||||
|
||||
test('get custom message', () => {
|
||||
const test = getCommitMessage('Custom msg', '', '', 'actions/pages', 'commit_hash');
|
||||
expect(test).toMatch('Custom msg commit_hash');
|
||||
});
|
||||
|
||||
test('get custom message for external repository', () => {
|
||||
const test = getCommitMessage(
|
||||
'Custom msg',
|
||||
'',
|
||||
'actions/actions.github.io',
|
||||
'actions/pages',
|
||||
'commit_hash'
|
||||
);
|
||||
expect(test).toMatch('Custom msg actions/pages@commit_hash');
|
||||
});
|
||||
|
||||
test('get full custom message', () => {
|
||||
const test = getCommitMessage('', 'Full custom msg', '', 'actions/pages', 'commit_hash');
|
||||
expect(test).toMatch('Full custom msg');
|
||||
});
|
||||
|
||||
test('get full custom message for external repository', () => {
|
||||
const test = getCommitMessage(
|
||||
'',
|
||||
'Full custom msg',
|
||||
'actions/actions.github.io',
|
||||
'actions/pages',
|
||||
'commit_hash'
|
||||
);
|
||||
expect(test).toMatch('Full custom msg');
|
||||
});
|
||||
});
|
||||
|
37
__tests__/set-tokens.ghes.test.ts
Normal file
37
__tests__/set-tokens.ghes.test.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import {setPersonalToken, setGithubToken} from '../src/set-tokens';
|
||||
|
||||
const OLD_ENV = process.env;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
process.env = {...OLD_ENV};
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
process.env = OLD_ENV; // Restore old environment
|
||||
});
|
||||
|
||||
describe('setGithubToken()', () => {
|
||||
test('return remote url with GITHUB_TOKEN gh-pages', () => {
|
||||
process.env.GITHUB_SERVER_URL = 'https://github.enterprise.server';
|
||||
const expected = 'https://x-access-token:GITHUB_TOKEN@github.enterprise.server/owner/repo.git';
|
||||
const test = setGithubToken(
|
||||
'GITHUB_TOKEN',
|
||||
'owner/repo',
|
||||
'gh-pages',
|
||||
'',
|
||||
'refs/heads/master',
|
||||
'push'
|
||||
);
|
||||
expect(test).toMatch(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('setPersonalToken()', () => {
|
||||
test('return remote url with personal access token', () => {
|
||||
process.env.GITHUB_SERVER_URL = 'https://github.enterprise.server';
|
||||
const expected = 'https://x-access-token:pat@github.enterprise.server/owner/repo.git';
|
||||
const test = setPersonalToken('pat', 'owner/repo');
|
||||
expect(test).toMatch(expected);
|
||||
});
|
||||
});
|
@ -1,8 +1,4 @@
|
||||
import {
|
||||
getPublishRepo,
|
||||
setPersonalToken,
|
||||
setGithubToken
|
||||
} from '../src/set-tokens';
|
||||
import {getPublishRepo, setPersonalToken, setGithubToken} from '../src/set-tokens';
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
@ -26,8 +22,7 @@ describe('getPublishRepo()', () => {
|
||||
|
||||
describe('setGithubToken()', () => {
|
||||
test('return remote url with GITHUB_TOKEN gh-pages', () => {
|
||||
const expected =
|
||||
'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
|
||||
const expected = 'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
|
||||
const test = setGithubToken(
|
||||
'GITHUB_TOKEN',
|
||||
'owner/repo',
|
||||
@ -40,8 +35,7 @@ describe('setGithubToken()', () => {
|
||||
});
|
||||
|
||||
test('return remote url with GITHUB_TOKEN master', () => {
|
||||
const expected =
|
||||
'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
|
||||
const expected = 'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
|
||||
const test = setGithubToken(
|
||||
'GITHUB_TOKEN',
|
||||
'owner/repo',
|
||||
@ -53,17 +47,36 @@ describe('setGithubToken()', () => {
|
||||
expect(test).toMatch(expected);
|
||||
});
|
||||
|
||||
test('throw error master to master', () => {
|
||||
test('return remote url with GITHUB_TOKEN gh-pages (RegExp)', () => {
|
||||
const expected = 'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
|
||||
const test = setGithubToken(
|
||||
'GITHUB_TOKEN',
|
||||
'owner/repo',
|
||||
'gh-pages',
|
||||
'',
|
||||
'refs/heads/gh-pages-base',
|
||||
'push'
|
||||
);
|
||||
expect(test).toMatch(expected);
|
||||
});
|
||||
|
||||
test('throw error gh-pages-base to gh-pages-base (RegExp)', () => {
|
||||
expect(() => {
|
||||
setGithubToken(
|
||||
'GITHUB_TOKEN',
|
||||
'owner/repo',
|
||||
'master',
|
||||
'gh-pages-base',
|
||||
'',
|
||||
'refs/heads/master',
|
||||
'refs/heads/gh-pages-base',
|
||||
'push'
|
||||
);
|
||||
}).toThrowError('You deploy from master to master');
|
||||
}).toThrow('You deploy from gh-pages-base to gh-pages-base');
|
||||
});
|
||||
|
||||
test('throw error master to master', () => {
|
||||
expect(() => {
|
||||
setGithubToken('GITHUB_TOKEN', 'owner/repo', 'master', '', 'refs/heads/master', 'push');
|
||||
}).toThrow('You deploy from master to master');
|
||||
});
|
||||
|
||||
test('throw error external repository with GITHUB_TOKEN', () => {
|
||||
@ -76,14 +89,14 @@ describe('setGithubToken()', () => {
|
||||
'refs/heads/master',
|
||||
'push'
|
||||
);
|
||||
}).toThrowError(
|
||||
'GITHUB_TOKEN does not support to push to an external repository'
|
||||
);
|
||||
}).toThrow(`\
|
||||
The generated GITHUB_TOKEN (github_token) does not support to push to an external repository.
|
||||
Use deploy_key or personal_token.
|
||||
`);
|
||||
});
|
||||
|
||||
test('return remote url with GITHUB_TOKEN pull_request', () => {
|
||||
const expected =
|
||||
'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
|
||||
const expected = 'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
|
||||
const test = setGithubToken(
|
||||
'GITHUB_TOKEN',
|
||||
'owner/repo',
|
||||
|
@ -3,9 +3,10 @@ import fs from 'fs';
|
||||
import {
|
||||
getHomeDir,
|
||||
getWorkDirName,
|
||||
createWorkDir,
|
||||
createDir,
|
||||
addNoJekyll,
|
||||
addCNAME
|
||||
addCNAME,
|
||||
skipOnFork
|
||||
} from '../src/utils';
|
||||
|
||||
beforeEach(() => {
|
||||
@ -50,11 +51,11 @@ describe('getWorkDirName()', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('createWorkDir()', () => {
|
||||
test('create work directory', async () => {
|
||||
describe('createDir()', () => {
|
||||
test('create a directory', async () => {
|
||||
const unixTime = await getTime();
|
||||
const workDirName = await getWorkDirName(`${unixTime}`);
|
||||
await createWorkDir(workDirName);
|
||||
await createDir(workDirName);
|
||||
const test = fs.existsSync(workDirName);
|
||||
expect(test).toBe(true);
|
||||
});
|
||||
@ -64,33 +65,19 @@ async function getWorkDir(): Promise<string> {
|
||||
const unixTime = await getTime();
|
||||
let workDir = '';
|
||||
workDir = await getWorkDirName(`${unixTime}`);
|
||||
await createWorkDir(workDir);
|
||||
await createDir(workDir);
|
||||
return workDir;
|
||||
}
|
||||
|
||||
describe('addNoJekyll()', () => {
|
||||
test('add .nojekyll gh-pages', async () => {
|
||||
test('add .nojekyll', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, false, 'gh-pages');
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(true);
|
||||
|
||||
fs.unlinkSync(filepath);
|
||||
});
|
||||
|
||||
test('add .nojekyll master', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, false, 'master');
|
||||
await addNoJekyll(workDir, false);
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(true);
|
||||
|
||||
@ -105,57 +92,21 @@ describe('addNoJekyll()', () => {
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
fs.closeSync(fs.openSync(filepath, 'w'));
|
||||
|
||||
await addNoJekyll(workDir, false, 'master');
|
||||
await addNoJekyll(workDir, false);
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(true);
|
||||
|
||||
fs.unlinkSync(filepath);
|
||||
});
|
||||
|
||||
test('not add .nojekyll disable_nojekyll gh-pages', async () => {
|
||||
test('not add .nojekyll disable_nojekyll', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, true, 'gh-pages');
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(false);
|
||||
});
|
||||
|
||||
test('not add .nojekyll disable_nojekyll master', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, true, 'master');
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(false);
|
||||
});
|
||||
|
||||
test('not add .nojekyll other-branch', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, false, 'other-branch');
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(false);
|
||||
});
|
||||
|
||||
test('not add .nojekyll disable_nojekyll other-branch', async () => {
|
||||
let workDir = '';
|
||||
(async (): Promise<void> => {
|
||||
workDir = await getWorkDir();
|
||||
})();
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
|
||||
await addNoJekyll(workDir, true, 'other-branch');
|
||||
await addNoJekyll(workDir, true);
|
||||
const test = fs.existsSync(filepath);
|
||||
expect(test).toBe(false);
|
||||
});
|
||||
@ -203,3 +154,30 @@ describe('addCNAME()', () => {
|
||||
fs.unlinkSync(filepath);
|
||||
});
|
||||
});
|
||||
|
||||
describe('skipOnFork()', () => {
|
||||
test('return false on upstream', async () => {
|
||||
const test = await skipOnFork(false, 'token', '', '');
|
||||
expect(test).toBeFalsy();
|
||||
});
|
||||
|
||||
test('return false on fork with github_token', async () => {
|
||||
const test = await skipOnFork(true, 'token', '', '');
|
||||
expect(test).toBeFalsy();
|
||||
});
|
||||
|
||||
test('return false on fork with deploy_key', async () => {
|
||||
const test = await skipOnFork(true, '', 'deploy_key', '');
|
||||
expect(test).toBeFalsy();
|
||||
});
|
||||
|
||||
test('return false on fork with personal_token', async () => {
|
||||
const test = await skipOnFork(true, '', '', 'personal_token');
|
||||
expect(test).toBeFalsy();
|
||||
});
|
||||
|
||||
test('return true on fork with no tokens', async () => {
|
||||
const test = await skipOnFork(true, '', '', '');
|
||||
expect(test).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
17
action.yml
17
action.yml
@ -2,7 +2,7 @@ name: 'GitHub Pages action'
|
||||
description: 'GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.'
|
||||
author: 'peaceiris'
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node20'
|
||||
main: 'lib/index.js'
|
||||
branding:
|
||||
icon: 'upload-cloud'
|
||||
@ -25,6 +25,10 @@ inputs:
|
||||
description: 'Set an input directory for deployment.'
|
||||
required: false
|
||||
default: 'public'
|
||||
destination_dir:
|
||||
description: 'Set an destination subdirectory for deployment.'
|
||||
required: false
|
||||
default: ''
|
||||
external_repository:
|
||||
description: 'Set an external repository (owner/repo).'
|
||||
required: false
|
||||
@ -47,7 +51,10 @@ inputs:
|
||||
description: 'Set Git user.email'
|
||||
required: false
|
||||
commit_message:
|
||||
description: 'Set custom commit message'
|
||||
description: 'Set a custom commit message with a triggered commit hash'
|
||||
required: false
|
||||
full_commit_message:
|
||||
description: 'Set a custom full commit message without a triggered commit hash'
|
||||
required: false
|
||||
tag_name:
|
||||
description: 'Set tag name'
|
||||
@ -60,9 +67,13 @@ inputs:
|
||||
required: false
|
||||
default: 'false'
|
||||
disable_nojekyll:
|
||||
description: 'An alias for enable_jekyll to disable adding .nojekyll file to master or gh-pages branches'
|
||||
description: 'An alias for enable_jekyll to disable adding .nojekyll file to a publishing branch'
|
||||
required: false
|
||||
default: 'false'
|
||||
cname:
|
||||
description: 'Set custom domain'
|
||||
required: false
|
||||
exclude_assets:
|
||||
description: 'Set files or directories to exclude from a publish directory.'
|
||||
required: false
|
||||
default: '.github'
|
||||
|
BIN
images/commit_message.jpg
Normal file
BIN
images/commit_message.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
Binary file not shown.
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
Before Width: | Height: | Size: 54 KiB |
@ -8,4 +8,4 @@ module.exports = {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
verbose: true
|
||||
}
|
||||
};
|
||||
|
26943
lib/index.js
26943
lib/index.js
File diff suppressed because it is too large
Load Diff
15678
package-lock.json
generated
15678
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
76
package.json
76
package.json
@ -1,34 +1,31 @@
|
||||
{
|
||||
"name": "actions-github-pages",
|
||||
"version": "3.5.2",
|
||||
"version": "4.0.0",
|
||||
"description": "GitHub Actions for GitHub Pages",
|
||||
"main": "lib/index.js",
|
||||
"engines": {
|
||||
"node": ">=12.16.1",
|
||||
"npm": ">=6.14.2"
|
||||
"node": ">=v20.11.0",
|
||||
"npm": ">=10.2.4"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "npx husky install",
|
||||
"all": "npm run format && npm run lint && npm test",
|
||||
"lint": "eslint ./{src,__tests__}/**/*.ts",
|
||||
"lint:fix": "eslint --fix ./{src,__tests__}/**/*.ts",
|
||||
"test": "jest --coverage --verbose --detectOpenHandles",
|
||||
"build": "ncc build ./src/index.ts -o lib",
|
||||
"build": "ncc build ./src/index.ts -o lib --minify",
|
||||
"tsc": "tsc",
|
||||
"format": "prettier --write **/*.ts",
|
||||
"format:check": "prettier --check **/*.ts",
|
||||
"release": "standard-version",
|
||||
"update-deps": "(git diff 'HEAD@{1}' --name-only | grep 'package-lock.json' > /dev/null) && npm ci || :"
|
||||
},
|
||||
"husky": {
|
||||
"skipCI": true,
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged",
|
||||
"post-merge": "npm run update-deps; git remote prune origin"
|
||||
}
|
||||
"format": "prettier --write '**/*.ts'",
|
||||
"format:check": "prettier --check '**/*.ts'",
|
||||
"release": "standard-version"
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.ts": [
|
||||
"{src,__tests__}/**/*.ts": [
|
||||
"prettier --check",
|
||||
"eslint"
|
||||
],
|
||||
"README.md": [
|
||||
"npx doctoc@2.1.0 --github"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
@ -50,28 +47,33 @@
|
||||
},
|
||||
"homepage": "https://github.com/peaceiris/actions-gh-pages#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.3",
|
||||
"@actions/exec": "^1.0.3",
|
||||
"@actions/github": "^2.1.1",
|
||||
"@actions/io": "^1.0.2"
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^5.1.1",
|
||||
"@actions/glob": "^0.5.0",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@types/shelljs": "^0.8.11",
|
||||
"shelljs": "^0.8.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^25.1.4",
|
||||
"@types/js-yaml": "^3.12.2",
|
||||
"@types/node": "~12",
|
||||
"@typescript-eslint/eslint-plugin": "^2.23.0",
|
||||
"@typescript-eslint/parser": "^2.23.0",
|
||||
"@zeit/ncc": "^0.21.1",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-plugin-jest": "^23.8.2",
|
||||
"husky": "^4.2.3",
|
||||
"jest": "^25.1.0",
|
||||
"jest-circus": "^25.1.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"lint-staged": "^10.0.8",
|
||||
"prettier": "1.19.1",
|
||||
"standard-version": "^7.1.0",
|
||||
"ts-jest": "^25.2.1",
|
||||
"typescript": "^3.8.3"
|
||||
"@types/jest": "^29.2.6",
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@types/node": "~16",
|
||||
"@typescript-eslint/eslint-plugin": "^5.48.2",
|
||||
"@typescript-eslint/parser": "^5.48.2",
|
||||
"@vercel/ncc": "^0.38.0",
|
||||
"eslint": "^8.32.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"husky": "^8.0.3",
|
||||
"jest": "^29.3.1",
|
||||
"jest-circus": "^29.3.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lint-staged": "^13.1.0",
|
||||
"prettier": "2.8.8",
|
||||
"standard-version": "^9.1.1",
|
||||
"ts-jest": "^29.0.5",
|
||||
"typescript": "^4.9.4"
|
||||
}
|
||||
}
|
||||
|
18
release.sh
18
release.sh
@ -3,9 +3,11 @@
|
||||
# fail on unset variables and command errors
|
||||
set -eu -o pipefail # -x: is for debugging
|
||||
|
||||
DEFAULT_BRANCH="main"
|
||||
|
||||
CURRENT_BRANCH="$(git branch --show-current)"
|
||||
if [ "${CURRENT_BRANCH}" != "master" ]; then
|
||||
echo "$0: Current branch ${CURRENT_BRANCH} is not master, continue? (y/n)"
|
||||
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
|
||||
echo "$0: Current branch ${CURRENT_BRANCH} is not ${DEFAULT_BRANCH}, continue? (y/n)"
|
||||
read -r res
|
||||
if [ "${res}" = "n" ]; then
|
||||
echo "$0: Stop script"
|
||||
@ -14,7 +16,7 @@ if [ "${CURRENT_BRANCH}" != "master" ]; then
|
||||
fi
|
||||
|
||||
PRERELEASE_TYPE_LIST="prerelease prepatch preminor premajor"
|
||||
if [ "${CURRENT_BRANCH}" != "master" ]; then
|
||||
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
|
||||
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST}"
|
||||
else
|
||||
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST} patch minor major"
|
||||
@ -37,15 +39,15 @@ if [ "${res}" = "n" ]; then
|
||||
fi
|
||||
|
||||
git fetch origin
|
||||
if [ "${CURRENT_BRANCH}" != "master" ]; then
|
||||
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
|
||||
git pull origin "${CURRENT_BRANCH}"
|
||||
else
|
||||
git pull origin master
|
||||
git pull origin ${DEFAULT_BRANCH}
|
||||
git tag -d v3 || true
|
||||
git pull origin --tags
|
||||
fi
|
||||
|
||||
npm ci
|
||||
npm install
|
||||
|
||||
mkdir ./lib
|
||||
npm run build
|
||||
@ -58,10 +60,10 @@ git rm ./lib/index.js
|
||||
rm -rf ./lib
|
||||
git commit -m "chore(release): Remove build assets [skip ci]"
|
||||
|
||||
if [ "${CURRENT_BRANCH}" != "master" ]; then
|
||||
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
|
||||
git push origin "${CURRENT_BRANCH}"
|
||||
else
|
||||
git push origin master
|
||||
git push origin ${DEFAULT_BRANCH}
|
||||
fi
|
||||
|
||||
TAG_NAME="v$(jq -r '.version' ./package.json)"
|
||||
|
13
renovate.json
Normal file
13
renovate.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"local>peaceiris/renovate-config"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"automerge": false,
|
||||
"matchUpdateTypes": ["minor", "patch"],
|
||||
"automergeStrategy": "squash"
|
||||
}
|
||||
]
|
||||
}
|
@ -15,6 +15,7 @@ export function showInputs(inps: Inputs): void {
|
||||
[INFO] ${authMethod}: true
|
||||
[INFO] PublishBranch: ${inps.PublishBranch}
|
||||
[INFO] PublishDir: ${inps.PublishDir}
|
||||
[INFO] DestinationDir: ${inps.DestinationDir}
|
||||
[INFO] ExternalRepository: ${inps.ExternalRepository}
|
||||
[INFO] AllowEmptyCommit: ${inps.AllowEmptyCommit}
|
||||
[INFO] KeepFiles: ${inps.KeepFiles}
|
||||
@ -22,20 +23,22 @@ export function showInputs(inps: Inputs): void {
|
||||
[INFO] UserName: ${inps.UserName}
|
||||
[INFO] UserEmail: ${inps.UserEmail}
|
||||
[INFO] CommitMessage: ${inps.CommitMessage}
|
||||
[INFO] FullCommitMessage: ${inps.FullCommitMessage}
|
||||
[INFO] TagName: ${inps.TagName}
|
||||
[INFO] TagMessage: ${inps.TagMessage}
|
||||
[INFO] EnableJekyll (DisableNoJekyll): ${inps.DisableNoJekyll}
|
||||
[INFO] CNAME: ${inps.CNAME}
|
||||
[INFO] ExcludeAssets ${inps.ExcludeAssets}
|
||||
`);
|
||||
}
|
||||
|
||||
export function getInputs(): Inputs {
|
||||
let useBuiltinJekyll = false;
|
||||
|
||||
const enableJekyll: boolean =
|
||||
(core.getInput('enable_jekyll') || 'false').toUpperCase() === 'TRUE';
|
||||
const disableNoJekyll: boolean =
|
||||
(core.getInput('disable_nojekyll') || 'false').toUpperCase() === 'TRUE';
|
||||
const isBoolean = (param: string): boolean => (param || 'false').toUpperCase() === 'TRUE';
|
||||
|
||||
const enableJekyll: boolean = isBoolean(core.getInput('enable_jekyll'));
|
||||
const disableNoJekyll: boolean = isBoolean(core.getInput('disable_nojekyll'));
|
||||
|
||||
if (enableJekyll && disableNoJekyll) {
|
||||
throw new Error(`Use either of enable_jekyll or disable_nojekyll`);
|
||||
@ -51,20 +54,20 @@ export function getInputs(): Inputs {
|
||||
PersonalToken: core.getInput('personal_token'),
|
||||
PublishBranch: core.getInput('publish_branch'),
|
||||
PublishDir: core.getInput('publish_dir'),
|
||||
DestinationDir: core.getInput('destination_dir'),
|
||||
ExternalRepository: core.getInput('external_repository'),
|
||||
AllowEmptyCommit:
|
||||
(core.getInput('allow_empty_commit') || 'false').toUpperCase() === 'TRUE',
|
||||
KeepFiles:
|
||||
(core.getInput('keep_files') || 'false').toUpperCase() === 'TRUE',
|
||||
ForceOrphan:
|
||||
(core.getInput('force_orphan') || 'false').toUpperCase() === 'TRUE',
|
||||
AllowEmptyCommit: isBoolean(core.getInput('allow_empty_commit')),
|
||||
KeepFiles: isBoolean(core.getInput('keep_files')),
|
||||
ForceOrphan: isBoolean(core.getInput('force_orphan')),
|
||||
UserName: core.getInput('user_name'),
|
||||
UserEmail: core.getInput('user_email'),
|
||||
CommitMessage: core.getInput('commit_message'),
|
||||
FullCommitMessage: core.getInput('full_commit_message'),
|
||||
TagName: core.getInput('tag_name'),
|
||||
TagMessage: core.getInput('tag_message'),
|
||||
DisableNoJekyll: useBuiltinJekyll,
|
||||
CNAME: core.getInput('cname')
|
||||
CNAME: core.getInput('cname'),
|
||||
ExcludeAssets: core.getInput('exclude_assets')
|
||||
};
|
||||
|
||||
return inps;
|
||||
|
184
src/git-utils.ts
184
src/git-utils.ts
@ -1,11 +1,12 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as github from '@actions/github';
|
||||
import * as io from '@actions/io';
|
||||
import * as glob from '@actions/glob';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import {URL} from 'url';
|
||||
import {Inputs, CmdResult} from './interfaces';
|
||||
import {createWorkDir} from './utils';
|
||||
import {createDir} from './utils';
|
||||
import {cp, rm} from 'shelljs';
|
||||
|
||||
export async function createBranchForce(branch: string): Promise<void> {
|
||||
await exec.exec('git', ['init']);
|
||||
@ -13,41 +14,79 @@ export async function createBranchForce(branch: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
export function getServerUrl(): URL {
|
||||
return new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
||||
}
|
||||
|
||||
export async function deleteExcludedAssets(destDir: string, excludeAssets: string): Promise<void> {
|
||||
if (excludeAssets === '') return;
|
||||
core.info(`[INFO] delete excluded assets`);
|
||||
const excludedAssetNames: Array<string> = excludeAssets.split(',');
|
||||
const excludedAssetPaths = ((): Array<string> => {
|
||||
const paths: Array<string> = [];
|
||||
for (const pattern of excludedAssetNames) {
|
||||
paths.push(path.join(destDir, pattern));
|
||||
}
|
||||
return paths;
|
||||
})();
|
||||
const globber = await glob.create(excludedAssetPaths.join('\n'));
|
||||
const files = await globber.glob();
|
||||
for await (const file of globber.globGenerator()) {
|
||||
core.info(`[INFO] delete ${file}`);
|
||||
}
|
||||
rm('-rf', files);
|
||||
return;
|
||||
}
|
||||
|
||||
export async function copyAssets(
|
||||
publishDir: string,
|
||||
workDir: string
|
||||
destDir: string,
|
||||
excludeAssets: string
|
||||
): Promise<void> {
|
||||
const copyOpts = {recursive: true, force: true};
|
||||
const files = fs.readdirSync(publishDir);
|
||||
core.debug(`${files}`);
|
||||
for await (const file of files) {
|
||||
if (file.endsWith('.git') || file.endsWith('.github')) {
|
||||
continue;
|
||||
core.info(`[INFO] prepare publishing assets`);
|
||||
|
||||
if (!fs.existsSync(destDir)) {
|
||||
core.info(`[INFO] create ${destDir}`);
|
||||
await createDir(destDir);
|
||||
}
|
||||
const filePath = path.join(publishDir, file);
|
||||
await io.cp(filePath, `${workDir}/`, copyOpts);
|
||||
core.info(`[INFO] copy ${file}`);
|
||||
|
||||
const dotGitPath = path.join(publishDir, '.git');
|
||||
if (fs.existsSync(dotGitPath)) {
|
||||
core.info(`[INFO] delete ${dotGitPath}`);
|
||||
rm('-rf', dotGitPath);
|
||||
}
|
||||
|
||||
core.info(`[INFO] copy ${publishDir} to ${destDir}`);
|
||||
cp('-RfL', [`${publishDir}/*`, `${publishDir}/.*`], destDir);
|
||||
|
||||
await deleteExcludedAssets(destDir, excludeAssets);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
export async function setRepo(
|
||||
inps: Inputs,
|
||||
remoteURL: string,
|
||||
workDir: string
|
||||
): Promise<void> {
|
||||
const publishDir = path.join(
|
||||
`${process.env.GITHUB_WORKSPACE}`,
|
||||
inps.PublishDir
|
||||
);
|
||||
export async function setRepo(inps: Inputs, remoteURL: string, workDir: string): Promise<void> {
|
||||
const publishDir = path.isAbsolute(inps.PublishDir)
|
||||
? inps.PublishDir
|
||||
: path.join(`${process.env.GITHUB_WORKSPACE}`, inps.PublishDir);
|
||||
|
||||
if (path.isAbsolute(inps.DestinationDir)) {
|
||||
throw new Error('destination_dir should be a relative path');
|
||||
}
|
||||
const destDir = ((): string => {
|
||||
if (inps.DestinationDir === '') {
|
||||
return workDir;
|
||||
} else {
|
||||
return path.join(workDir, inps.DestinationDir);
|
||||
}
|
||||
})();
|
||||
|
||||
core.info(`[INFO] ForceOrphan: ${inps.ForceOrphan}`);
|
||||
if (inps.ForceOrphan) {
|
||||
await createWorkDir(workDir);
|
||||
await createDir(destDir);
|
||||
core.info(`[INFO] chdir ${workDir}`);
|
||||
process.chdir(workDir);
|
||||
await createBranchForce(inps.PublishBranch);
|
||||
await copyAssets(publishDir, workDir);
|
||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -66,40 +105,41 @@ export async function setRepo(
|
||||
try {
|
||||
result.exitcode = await exec.exec(
|
||||
'git',
|
||||
[
|
||||
'clone',
|
||||
'--depth=1',
|
||||
'--single-branch',
|
||||
'--branch',
|
||||
inps.PublishBranch,
|
||||
remoteURL,
|
||||
workDir
|
||||
],
|
||||
['clone', '--depth=1', '--single-branch', '--branch', inps.PublishBranch, remoteURL, workDir],
|
||||
options
|
||||
);
|
||||
if (result.exitcode === 0) {
|
||||
process.chdir(workDir);
|
||||
await createDir(destDir);
|
||||
|
||||
if (inps.KeepFiles) {
|
||||
core.info('[INFO] Keep existing files');
|
||||
} else {
|
||||
core.info(`[INFO] clean up ${destDir}`);
|
||||
core.info(`[INFO] chdir ${destDir}`);
|
||||
process.chdir(destDir);
|
||||
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
||||
}
|
||||
|
||||
await copyAssets(publishDir, workDir);
|
||||
core.info(`[INFO] chdir ${workDir}`);
|
||||
process.chdir(workDir);
|
||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||
return;
|
||||
} else {
|
||||
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
||||
}
|
||||
} catch (e) {
|
||||
core.info(
|
||||
`[INFO] first deployment, create new branch ${inps.PublishBranch}`
|
||||
);
|
||||
core.info(e.message);
|
||||
await createWorkDir(workDir);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
||||
core.info(`[INFO] ${error.message}`);
|
||||
await createDir(destDir);
|
||||
core.info(`[INFO] chdir ${workDir}`);
|
||||
process.chdir(workDir);
|
||||
await createBranchForce(inps.PublishBranch);
|
||||
await copyAssets(publishDir, workDir);
|
||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||
return;
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,10 +159,7 @@ export function getUserEmail(userEmail: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
export async function setCommitAuthor(
|
||||
userName: string,
|
||||
userEmail: string
|
||||
): Promise<void> {
|
||||
export async function setCommitAuthor(userName: string, userEmail: string): Promise<void> {
|
||||
if (userName && !userEmail) {
|
||||
throw new Error('user_email is undefined');
|
||||
}
|
||||
@ -133,42 +170,52 @@ export async function setCommitAuthor(
|
||||
await exec.exec('git', ['config', 'user.email', getUserEmail(userEmail)]);
|
||||
}
|
||||
|
||||
export async function commit(
|
||||
allowEmptyCommit: boolean,
|
||||
externalRepository: string,
|
||||
message: string
|
||||
): Promise<void> {
|
||||
let msg = '';
|
||||
if (message) {
|
||||
msg = message;
|
||||
export function getCommitMessage(
|
||||
msg: string,
|
||||
fullMsg: string,
|
||||
extRepo: string,
|
||||
baseRepo: string,
|
||||
hash: string
|
||||
): string {
|
||||
const msgHash = ((): string => {
|
||||
if (extRepo) {
|
||||
return `${baseRepo}@${hash}`;
|
||||
} else {
|
||||
msg = 'deploy:';
|
||||
return hash;
|
||||
}
|
||||
})();
|
||||
|
||||
const hash = `${process.env.GITHUB_SHA}`;
|
||||
const baseRepo = `${github.context.repo.owner}/${github.context.repo.repo}`;
|
||||
if (externalRepository) {
|
||||
msg = `${msg} ${baseRepo}@${hash}`;
|
||||
const subject = ((): string => {
|
||||
if (fullMsg) {
|
||||
return fullMsg;
|
||||
} else if (msg) {
|
||||
return `${msg} ${msgHash}`;
|
||||
} else {
|
||||
msg = `${msg} ${hash}`;
|
||||
return `deploy: ${msgHash}`;
|
||||
}
|
||||
})();
|
||||
|
||||
return subject;
|
||||
}
|
||||
|
||||
export async function commit(allowEmptyCommit: boolean, msg: string): Promise<void> {
|
||||
try {
|
||||
if (allowEmptyCommit) {
|
||||
await exec.exec('git', ['commit', '--allow-empty', '-m', `${msg}`]);
|
||||
} else {
|
||||
await exec.exec('git', ['commit', '-m', `${msg}`]);
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
core.info('[INFO] skip commit');
|
||||
core.debug(`[INFO] skip commit ${e.message}`);
|
||||
core.debug(`[INFO] skip commit ${error.message}`);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function push(
|
||||
branch: string,
|
||||
forceOrphan: boolean
|
||||
): Promise<void> {
|
||||
export async function push(branch: string, forceOrphan: boolean): Promise<void> {
|
||||
if (forceOrphan) {
|
||||
await exec.exec('git', ['push', 'origin', '--force', branch]);
|
||||
} else {
|
||||
@ -176,10 +223,7 @@ export async function push(
|
||||
}
|
||||
}
|
||||
|
||||
export async function pushTag(
|
||||
tagName: string,
|
||||
tagMessage: string
|
||||
): Promise<void> {
|
||||
export async function pushTag(tagName: string, tagMessage: string): Promise<void> {
|
||||
if (tagName === '') {
|
||||
return;
|
||||
}
|
||||
|
@ -4,7 +4,11 @@ import * as main from './main';
|
||||
(async (): Promise<void> => {
|
||||
try {
|
||||
await main.run();
|
||||
} catch (e) {
|
||||
core.setFailed(`Action failed with "${e.message}"`);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
core.setFailed(`Action failed with "${error.message}"`);
|
||||
} else {
|
||||
core.setFailed('unexpected error');
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
@ -4,6 +4,7 @@ export interface Inputs {
|
||||
readonly PersonalToken: string;
|
||||
readonly PublishBranch: string;
|
||||
readonly PublishDir: string;
|
||||
readonly DestinationDir: string;
|
||||
readonly ExternalRepository: string;
|
||||
readonly AllowEmptyCommit: boolean;
|
||||
readonly KeepFiles: boolean;
|
||||
@ -11,10 +12,12 @@ export interface Inputs {
|
||||
readonly UserName: string;
|
||||
readonly UserEmail: string;
|
||||
readonly CommitMessage: string;
|
||||
readonly FullCommitMessage: string;
|
||||
readonly TagName: string;
|
||||
readonly TagMessage: string;
|
||||
readonly DisableNoJekyll: boolean;
|
||||
readonly CNAME: string;
|
||||
readonly ExcludeAssets: string;
|
||||
}
|
||||
|
||||
export interface CmdResult {
|
||||
|
77
src/main.ts
77
src/main.ts
@ -1,47 +1,100 @@
|
||||
import {context} from '@actions/github';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as github from '@actions/github';
|
||||
import {Inputs} from './interfaces';
|
||||
import {showInputs, getInputs} from './get-inputs';
|
||||
import {setTokens} from './set-tokens';
|
||||
import {setRepo, setCommitAuthor, commit, push, pushTag} from './git-utils';
|
||||
import {getWorkDirName, addNoJekyll, addCNAME} from './utils';
|
||||
import {setRepo, setCommitAuthor, getCommitMessage, commit, push, pushTag} from './git-utils';
|
||||
import {getWorkDirName, addNoJekyll, addCNAME, skipOnFork} from './utils';
|
||||
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
core.info('[INFO] Usage https://github.com/peaceiris/actions-gh-pages#readme');
|
||||
|
||||
const inps: Inputs = getInputs();
|
||||
core.startGroup('Dump inputs');
|
||||
showInputs(inps);
|
||||
core.endGroup();
|
||||
|
||||
if (core.isDebug()) {
|
||||
core.startGroup('Debug: dump context');
|
||||
console.log(context);
|
||||
core.endGroup();
|
||||
}
|
||||
|
||||
const eventName = context.eventName;
|
||||
if (eventName === 'pull_request' || eventName === 'push') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isForkRepository = (context.payload as any).repository.fork;
|
||||
const isSkipOnFork = await skipOnFork(
|
||||
isForkRepository,
|
||||
inps.GithubToken,
|
||||
inps.DeployKey,
|
||||
inps.PersonalToken
|
||||
);
|
||||
if (isSkipOnFork) {
|
||||
core.warning('This action runs on a fork and not found auth token, Skip deployment');
|
||||
core.setOutput('skip', 'true');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
core.startGroup('Setup auth token');
|
||||
const remoteURL = await setTokens(inps);
|
||||
core.debug(`[INFO] remoteURL: ${remoteURL}`);
|
||||
core.debug(`remoteURL: ${remoteURL}`);
|
||||
core.endGroup();
|
||||
|
||||
core.startGroup('Prepare publishing assets');
|
||||
const date = new Date();
|
||||
const unixTime = date.getTime();
|
||||
const workDir = await getWorkDirName(`${unixTime}`);
|
||||
await setRepo(inps, remoteURL, workDir);
|
||||
|
||||
await addNoJekyll(workDir, inps.DisableNoJekyll, inps.PublishBranch);
|
||||
await addNoJekyll(workDir, inps.DisableNoJekyll);
|
||||
await addCNAME(workDir, inps.CNAME);
|
||||
core.endGroup();
|
||||
|
||||
core.startGroup('Setup Git config');
|
||||
try {
|
||||
await exec.exec('git', ['remote', 'rm', 'origin']);
|
||||
} catch (e) {
|
||||
core.info(`[INFO] ${e.message}`);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
core.info(`[INFO] ${error.message}`);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
await exec.exec('git', ['remote', 'add', 'origin', remoteURL]);
|
||||
await exec.exec('git', ['add', '--all']);
|
||||
await setCommitAuthor(inps.UserName, inps.UserEmail);
|
||||
await commit(
|
||||
inps.AllowEmptyCommit,
|
||||
core.endGroup();
|
||||
|
||||
core.startGroup('Create a commit');
|
||||
const hash = `${process.env.GITHUB_SHA}`;
|
||||
const baseRepo = `${github.context.repo.owner}/${github.context.repo.repo}`;
|
||||
const commitMessage = getCommitMessage(
|
||||
inps.CommitMessage,
|
||||
inps.FullCommitMessage,
|
||||
inps.ExternalRepository,
|
||||
inps.CommitMessage
|
||||
baseRepo,
|
||||
hash
|
||||
);
|
||||
await commit(inps.AllowEmptyCommit, commitMessage);
|
||||
core.endGroup();
|
||||
|
||||
core.startGroup('Push the commit or tag');
|
||||
await push(inps.PublishBranch, inps.ForceOrphan);
|
||||
await pushTag(inps.TagName, inps.TagMessage);
|
||||
core.endGroup();
|
||||
|
||||
core.info('[INFO] Action successfully completed');
|
||||
|
||||
return;
|
||||
} catch (e) {
|
||||
throw new Error(e.message);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,15 +4,15 @@ import * as github from '@actions/github';
|
||||
import * as io from '@actions/io';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const cpSpawnSync = require('child_process').spawnSync;
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const cpexec = require('child_process').execFileSync;
|
||||
import {Inputs} from './interfaces';
|
||||
import {getHomeDir} from './utils';
|
||||
import {getServerUrl} from './git-utils';
|
||||
|
||||
export async function setSSHKey(
|
||||
inps: Inputs,
|
||||
publishRepo: string
|
||||
): Promise<string> {
|
||||
export async function setSSHKey(inps: Inputs, publishRepo: string): Promise<string> {
|
||||
core.info('[INFO] setup SSH deploy key');
|
||||
|
||||
const homeDir = await getHomeDir();
|
||||
@ -21,10 +21,12 @@ export async function setSSHKey(
|
||||
await exec.exec('chmod', ['700', sshDir]);
|
||||
|
||||
const knownHosts = path.join(sshDir, 'known_hosts');
|
||||
// ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts on Ubuntu
|
||||
// ssh-keyscan -t rsa github.com or serverUrl >> ~/.ssh/known_hosts on Ubuntu
|
||||
const cmdSSHkeyscanOutput = `\
|
||||
# github.com:22 SSH-2.0-babeld-1f0633a6
|
||||
github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
|
||||
# ${getServerUrl().host}.com:22 SSH-2.0-babeld-1f0633a6
|
||||
${
|
||||
getServerUrl().host
|
||||
} ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
|
||||
`;
|
||||
fs.writeFileSync(knownHosts, cmdSSHkeyscanOutput + '\n');
|
||||
core.info(`[INFO] wrote ${knownHosts}`);
|
||||
@ -37,8 +39,8 @@ github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXY
|
||||
|
||||
const sshConfigPath = path.join(sshDir, 'config');
|
||||
const sshConfigContent = `\
|
||||
Host github
|
||||
HostName github.com
|
||||
Host ${getServerUrl().host}
|
||||
HostName ${getServerUrl().host}
|
||||
IdentityFile ~/.ssh/github
|
||||
User git
|
||||
`;
|
||||
@ -47,6 +49,11 @@ Host github
|
||||
await exec.exec('chmod', ['600', sshConfigPath]);
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
core.warning(`\
|
||||
Currently, the deploy_key option is not supported on the windows-latest.
|
||||
Watch https://github.com/peaceiris/actions-gh-pages/issues/87
|
||||
`);
|
||||
|
||||
await cpSpawnSync('Start-Process', ['powershell.exe', '-Verb', 'runas']);
|
||||
await cpSpawnSync('sh', ['-c', '\'eval "$(ssh-agent)"\''], {shell: true});
|
||||
await exec.exec('sc', ['config', 'ssh-agent', 'start=auto']);
|
||||
@ -56,7 +63,7 @@ Host github
|
||||
core.exportVariable('SSH_AUTH_SOCK', '/tmp/ssh-auth.sock');
|
||||
await exec.exec('ssh-add', [idRSA]);
|
||||
|
||||
return `git@github.com:${publishRepo}.git`;
|
||||
return `git@${getServerUrl().host}:${publishRepo}.git`;
|
||||
}
|
||||
|
||||
export function setGithubToken(
|
||||
@ -73,35 +80,32 @@ export function setGithubToken(
|
||||
core.debug(`eventName: ${eventName}`);
|
||||
let isProhibitedBranch = false;
|
||||
|
||||
if (eventName === 'push') {
|
||||
isProhibitedBranch = ref.includes(`refs/heads/${publishBranch}`);
|
||||
if (isProhibitedBranch) {
|
||||
throw new Error(`You deploy from ${publishBranch} to ${publishBranch}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (externalRepository) {
|
||||
throw new Error(
|
||||
'GITHUB_TOKEN does not support to push to an external repository'
|
||||
);
|
||||
throw new Error(`\
|
||||
The generated GITHUB_TOKEN (github_token) does not support to push to an external repository.
|
||||
Use deploy_key or personal_token.
|
||||
`);
|
||||
}
|
||||
|
||||
return `https://x-access-token:${githubToken}@github.com/${publishRepo}.git`;
|
||||
if (eventName === 'push') {
|
||||
isProhibitedBranch = ref.match(new RegExp(`^refs/heads/${publishBranch}$`)) !== null;
|
||||
if (isProhibitedBranch) {
|
||||
throw new Error(`\
|
||||
You deploy from ${publishBranch} to ${publishBranch}
|
||||
This operation is prohibited to protect your contents
|
||||
`);
|
||||
}
|
||||
}
|
||||
|
||||
return `https://x-access-token:${githubToken}@${getServerUrl().host}/${publishRepo}.git`;
|
||||
}
|
||||
|
||||
export function setPersonalToken(
|
||||
personalToken: string,
|
||||
publishRepo: string
|
||||
): string {
|
||||
export function setPersonalToken(personalToken: string, publishRepo: string): string {
|
||||
core.info('[INFO] setup personal access token');
|
||||
return `https://x-access-token:${personalToken}@github.com/${publishRepo}.git`;
|
||||
return `https://x-access-token:${personalToken}@${getServerUrl().host}/${publishRepo}.git`;
|
||||
}
|
||||
|
||||
export function getPublishRepo(
|
||||
externalRepository: string,
|
||||
owner: string,
|
||||
repo: string
|
||||
): string {
|
||||
export function getPublishRepo(externalRepository: string, owner: string, repo: string): string {
|
||||
if (externalRepository) {
|
||||
return externalRepository;
|
||||
}
|
||||
@ -134,7 +138,11 @@ export async function setTokens(inps: Inputs): Promise<string> {
|
||||
} else {
|
||||
throw new Error('not found deploy key or tokens');
|
||||
}
|
||||
} catch (e) {
|
||||
throw new Error(e.message);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(error.message);
|
||||
} else {
|
||||
throw new Error('unexpected error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
36
src/utils.ts
36
src/utils.ts
@ -23,42 +23,48 @@ export async function getWorkDirName(unixTime: string): Promise<string> {
|
||||
return workDirName;
|
||||
}
|
||||
|
||||
export async function createWorkDir(workDirName: string): Promise<void> {
|
||||
await io.mkdirP(workDirName);
|
||||
core.debug(`Created: ${workDirName}`);
|
||||
export async function createDir(dirPath: string): Promise<void> {
|
||||
await io.mkdirP(dirPath);
|
||||
core.debug(`Created directory ${dirPath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
export async function addNoJekyll(
|
||||
workDir: string,
|
||||
DisableNoJekyll: boolean,
|
||||
PublishBranch: string
|
||||
): Promise<void> {
|
||||
export async function addNoJekyll(workDir: string, DisableNoJekyll: boolean): Promise<void> {
|
||||
if (DisableNoJekyll) {
|
||||
return;
|
||||
}
|
||||
if (PublishBranch === 'master' || PublishBranch === 'gh-pages') {
|
||||
const filepath = path.join(workDir, '.nojekyll');
|
||||
if (fs.existsSync(filepath)) {
|
||||
return;
|
||||
}
|
||||
fs.closeSync(fs.openSync(filepath, 'w'));
|
||||
core.info(`[INFO] Created ${filepath}`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function addCNAME(
|
||||
workDir: string,
|
||||
content: string
|
||||
): Promise<void> {
|
||||
export async function addCNAME(workDir: string, content: string): Promise<void> {
|
||||
if (content === '') {
|
||||
return;
|
||||
}
|
||||
const filepath = path.join(workDir, 'CNAME');
|
||||
if (fs.existsSync(filepath)) {
|
||||
core.warning(`CNAME already exists, skip adding CNAME`);
|
||||
core.info(`CNAME already exists, skip adding CNAME`);
|
||||
return;
|
||||
}
|
||||
fs.writeFileSync(filepath, content + '\n');
|
||||
core.info(`[INFO] Created ${filepath}`);
|
||||
}
|
||||
|
||||
export async function skipOnFork(
|
||||
isForkRepository: boolean,
|
||||
githubToken: string,
|
||||
deployKey: string,
|
||||
personalToken: string
|
||||
): Promise<boolean> {
|
||||
if (isForkRepository) {
|
||||
if (githubToken === '' && deployKey === '' && personalToken === '') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1,64 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
// "incremental": true, /* Enable incremental compilation */
|
||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
||||
"sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "composite": true, /* Enable project compilation */
|
||||
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
||||
"removeComments": true, /* Do not emit comments to output. */
|
||||
// "noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
||||
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
|
||||
"lib": ["ES2019"],
|
||||
"module": "commonjs",
|
||||
"target": "ES2019",
|
||||
"sourceMap": true,
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
"removeComments": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"exclude": ["node_modules", "**/*.test.ts"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user