Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a0ba4ba74 | ||
|
|
ae29a2751b | ||
|
|
b48854e1ac | ||
|
|
9d912b1840 | ||
|
|
7a0147b5c6 | ||
|
|
5793b08cd9 | ||
|
|
ed3ea3b5ba | ||
|
|
c9c663babe | ||
|
|
0fc1805b46 | ||
|
|
a6e9f4bab2 | ||
|
|
758b556388 | ||
|
|
9e060cb3e1 | ||
|
|
5501ba08b7 | ||
|
|
4446f00fc7 | ||
|
|
965dcc7493 | ||
|
|
d464f9dd60 | ||
|
|
c9ab4f9548 | ||
|
|
a2986ee511 | ||
|
|
e827417593 | ||
|
|
b05d26b3fa | ||
|
|
ecdfc18bf2 | ||
|
|
e8e0ce7ad8 | ||
|
|
dc6427f3c3 | ||
|
|
76339b5f68 | ||
|
|
c0ef67ec49 | ||
|
|
968fd7f8d3 | ||
|
|
9b27fa97f9 | ||
|
|
065cf9f0b1 | ||
|
|
b77f226465 | ||
|
|
f61ae48376 | ||
|
|
4236fc3e78 | ||
|
|
f366966232 | ||
|
|
bd561a6765 | ||
|
|
26490f0d3b | ||
|
|
ee91adfbc4 | ||
|
|
a039cff4a1 | ||
|
|
9dd77993e7 | ||
|
|
dd1bb93c72 | ||
|
|
7292b3508f | ||
|
|
4a47af6481 | ||
|
|
a68693e20a | ||
|
|
acf4bd70fb | ||
|
|
7ae5c2f423 | ||
|
|
d5470e6023 | ||
|
|
e68ab4b91a | ||
|
|
d3a48dd52f | ||
|
|
c4d47c1922 | ||
|
|
5fc5cdde44 | ||
|
|
2a9d836b08 | ||
|
|
3a3b073ef2 | ||
|
|
d3a0fb260e | ||
|
|
be4fdc505f | ||
|
|
6be37922c5 | ||
|
|
dfc20acda2 | ||
|
|
dc1fec82a6 | ||
|
|
9339b3573b | ||
|
|
67a08de5c7 | ||
|
|
d73fffceed | ||
|
|
16f0b3d28e | ||
|
|
398e2cb68b | ||
|
|
4b9031fa77 | ||
|
|
959cb66bd5 | ||
|
|
3e0b611f99 | ||
|
|
83c13c81ba | ||
|
|
bccbba401a | ||
|
|
3a191eecf6 | ||
|
|
97f5a6f0dc | ||
|
|
48a7cdbf9c | ||
|
|
3f1933edf9 | ||
|
|
2215c8e5aa | ||
|
|
af6de2cb95 | ||
|
|
1dc58e3080 | ||
|
|
20596c1d96 | ||
|
|
557f80fd03 | ||
|
|
32c52bb78a | ||
|
|
6d9a3fe547 | ||
|
|
4e1c194b34 | ||
|
|
09cb71a033 | ||
|
|
2506e78e82 | ||
|
|
f8003d52ff | ||
|
|
e263dfb89d | ||
|
|
2e53bd8485 | ||
|
|
b5e3b25b34 | ||
|
|
b71834a510 | ||
|
|
c6f0239e63 | ||
|
|
c655f38a0f | ||
|
|
cf8caa4e0d | ||
|
|
8734e578c6 | ||
|
|
74ac6db523 | ||
|
|
6fc2f678c8 | ||
|
|
5ef62e14dd | ||
|
|
7b29e67278 | ||
|
|
9d2227dbb0 | ||
|
|
5a8462ec27 | ||
|
|
fcaf488df6 | ||
|
|
2b48e40e62 | ||
|
|
44ec738e27 | ||
|
|
3af0128b01 | ||
|
|
e74405f68c | ||
|
|
cc6abe3c3a | ||
|
|
c6502bc679 | ||
|
|
bdd6eb4293 | ||
|
|
6785788751 | ||
|
|
ddf2d52556 | ||
|
|
7c1b12a15e | ||
|
|
fdbf9e3ec2 | ||
|
|
369aa55cdc | ||
|
|
e1191599bb | ||
|
|
c043714a35 | ||
|
|
3ac6e0fdf2 | ||
|
|
d9f9074fee | ||
|
|
2c52220624 | ||
|
|
b2e6a5a284 | ||
|
|
e48877e66c | ||
|
|
bdddd872e3 | ||
|
|
8a2701f328 | ||
|
|
eb7ff8401e | ||
|
|
45ec4a2087 | ||
|
|
02869fefb4 | ||
|
|
701191f50e | ||
|
|
539724611c | ||
|
|
3d01d7ed69 | ||
|
|
d75223fd4a | ||
|
|
056c217a52 | ||
|
|
d795a0ad0d | ||
|
|
b0464628c0 | ||
|
|
0380590fdd | ||
|
|
5e183dabac | ||
|
|
97b7fa81c8 | ||
|
|
87afd16bb2 | ||
|
|
c40fa0d905 | ||
|
|
dc9f635a0d | ||
|
|
7847d31696 | ||
|
|
10d3b034e0 | ||
|
|
8eca440361 | ||
|
|
6ec87f46b7 | ||
|
|
d1f9584cda | ||
|
|
b8933d0495 | ||
|
|
0a988d204e | ||
|
|
136f9dfe37 | ||
|
|
ed78411ffb | ||
|
|
dd097c7f4e | ||
|
|
f01262913d | ||
|
|
c034e76488 | ||
|
|
9ca26d4946 | ||
|
|
417dbfff73 | ||
|
|
8883833d6d | ||
|
|
79efd648ac | ||
|
|
e8c242695d | ||
|
|
48f166f6d5 | ||
|
|
4bc377e1b4 | ||
|
|
bf1b64008f | ||
|
|
894f77901e | ||
|
|
7993066184 | ||
|
|
f014075da9 | ||
|
|
4500de75c1 | ||
|
|
47017fa24b | ||
|
|
d97deb1f60 | ||
|
|
df111e1104 | ||
|
|
a3588a70ba | ||
|
|
6b63a2bfc3 | ||
|
|
290017ff81 | ||
|
|
2a876cd69d | ||
|
|
7cba4c8084 | ||
|
|
f79b906406 | ||
|
|
1bcc453b44 | ||
|
|
dcae869a03 | ||
|
|
23769d04c7 | ||
|
|
d3ab50471b | ||
|
|
1388fd1cac | ||
|
|
5b446d2657 | ||
|
|
006d6978c1 | ||
|
|
02afeb1577 | ||
|
|
d47594b536 | ||
|
|
2823824b94 | ||
|
|
cbc06d6766 | ||
|
|
9bb6708527 | ||
|
|
be1151df02 | ||
|
|
130842f4e8 | ||
|
|
ab82301c62 | ||
|
|
fea4f6b5c5 | ||
|
|
d3ade9ecfc | ||
|
|
fb592eec03 | ||
|
|
70e79399a2 | ||
|
|
acb230b99a | ||
|
|
5e0fa1aaaa | ||
|
|
ac2468e605 | ||
|
|
3c8fcfce19 | ||
|
|
45467b9199 | ||
|
|
700a55077d | ||
|
|
6fa8f07827 | ||
|
|
d16e86a709 | ||
|
|
ae3ac0db0c | ||
|
|
b319d6afff | ||
|
|
b8ac8fc14a | ||
|
|
028d621193 | ||
|
|
b0d901f9c2 | ||
|
|
394e804dc8 | ||
|
|
d402248c45 | ||
|
|
66e8437b3e | ||
|
|
9c7501a5f3 | ||
|
|
3b4b5725f0 | ||
|
|
9a364e607b | ||
|
|
625c3f4856 | ||
|
|
1c3a637017 | ||
|
|
ec0ca1b19b | ||
|
|
57cd003e61 | ||
|
|
b5befc6c6d | ||
|
|
88a490d2ce | ||
|
|
a8d1fb0687 | ||
|
|
347c887e54 | ||
|
|
d5af54ee78 | ||
|
|
44b9401378 | ||
|
|
fb5ae2a0e0 | ||
|
|
8024983ab0 | ||
|
|
d44f9b8f13 | ||
|
|
9b4ee219ef | ||
|
|
ee5d8970ad | ||
|
|
2874e3a741 | ||
|
|
ad4afeeff1 | ||
|
|
f9bdf6a054 | ||
|
|
59c7ebde79 | ||
|
|
0c907a43d3 | ||
|
|
d1c1fc4108 | ||
|
|
36f30e6d37 | ||
|
|
308e05bc50 | ||
|
|
33a9b6c09c | ||
|
|
ddc5fa4ae8 | ||
|
|
9b08f07cd3 | ||
|
|
d26e9423f4 | ||
|
|
714f93aedc | ||
|
|
844423665b | ||
|
|
f2ba502b92 | ||
|
|
1db3130eb3 | ||
|
|
ca8a35d78f | ||
|
|
f7f057193f | ||
|
|
8e146e124e | ||
|
|
1ea77a84d7 | ||
|
|
7da95b182e | ||
|
|
7c689a5156 | ||
|
|
8c6c662cda | ||
|
|
3898ed70c4 | ||
|
|
9a41b33065 | ||
|
|
7aea3e735f | ||
|
|
b1eb18b224 | ||
|
|
48e42b1fdd | ||
|
|
b738f10ef3 | ||
|
|
8f32f385e0 | ||
|
|
011f07d1dc | ||
|
|
aa7077acfb | ||
|
|
86207b5042 | ||
|
|
523ce8ccda | ||
|
|
f58042f9cc | ||
|
|
091616a0b8 | ||
|
|
8da1e670b6 | ||
|
|
06f7fd9df1 | ||
|
|
0fe20e9d56 | ||
|
|
f82db4c00b | ||
|
|
b8cca0c71f | ||
|
|
6f0cb0c45e | ||
|
|
944ede4d09 | ||
|
|
227b1ce741 | ||
|
|
447ee85f36 | ||
|
|
a6be3de743 | ||
|
|
26b94036cb | ||
|
|
f3e6fb165e | ||
|
|
3a607d0f00 | ||
|
|
c9316bb4a7 | ||
|
|
ec43e5810d | ||
|
|
01715621b0 | ||
|
|
6c64260c6d | ||
|
|
bf3fc9226a | ||
|
|
c6723084aa | ||
|
|
bcb928642f | ||
|
|
8c3fc9ed99 | ||
|
|
1ef3214cee | ||
|
|
ece2273b24 | ||
|
|
717b895584 | ||
|
|
8ff772deb1 | ||
|
|
8a3652e16d | ||
|
|
eb6226501b | ||
|
|
d65ee66d9b | ||
|
|
6d3feab2bf | ||
|
|
79e1d8bb74 | ||
|
|
a0907ed2e2 | ||
|
|
bd54a2413a | ||
|
|
89397db14b | ||
|
|
d48d6b62a4 | ||
|
|
bab3dcf7f3 | ||
|
|
c51178a15e | ||
|
|
bbc6082700 | ||
|
|
cf3aaeb491 | ||
|
|
cf4886cccb | ||
|
|
0c5da92b52 | ||
|
|
513216f1dd | ||
|
|
3c90578c30 | ||
|
|
be5a2ce677 | ||
|
|
683703c114 | ||
|
|
c28e7d4d5f | ||
|
|
12e323ae30 | ||
|
|
dbb1ea35ff | ||
|
|
f31c2921c1 | ||
|
|
41b3ce3141 | ||
|
|
8d8a914a94 | ||
|
|
36db4d62ad | ||
|
|
a25b686a45 | ||
|
|
957610a37a | ||
|
|
6ed621e7d1 | ||
|
|
8007c1c535 | ||
|
|
6444290c57 | ||
|
|
f32d6bc043 | ||
|
|
2e4ab87130 | ||
|
|
ef199a9ab0 | ||
|
|
917a43eb6e | ||
|
|
07cac0a6b3 | ||
|
|
2046ee6d6b | ||
|
|
2b476323c4 | ||
|
|
aebe304a19 | ||
|
|
e8f276a715 | ||
|
|
d156bcaa78 | ||
|
|
5ae4c5be28 | ||
|
|
d50f1ac1b9 | ||
|
|
87cb7035bb | ||
|
|
1b1e81526b | ||
|
|
525ebf0c50 | ||
|
|
07341e11d8 | ||
|
|
930c890727 | ||
|
|
a410c4a9cf | ||
|
|
10277d48ca | ||
|
|
857c61a9df | ||
|
|
c40bccc9c3 | ||
|
|
ff4d4afef8 | ||
|
|
4d4bbebd6a | ||
|
|
261fcae498 | ||
|
|
4059d2af66 | ||
|
|
2559a2ac8a | ||
|
|
514314311c | ||
|
|
957d42e6c5 | ||
|
|
39419dd8c3 | ||
|
|
d13e6311f1 | ||
|
|
6876e2a664 | ||
|
|
fc482662af | ||
|
|
abd9054c61 | ||
|
|
253e837c4d | ||
|
|
3ac34ffcb7 | ||
|
|
56c5a39afb | ||
|
|
7ae578ddd1 | ||
|
|
b2d2270685 | ||
|
|
0d1d5c7687 | ||
|
|
769bb0fea1 | ||
|
|
d7ddca4309 | ||
|
|
8780507298 | ||
|
|
790c56665a | ||
|
|
9d8017eadb | ||
|
|
20fee3ea63 | ||
|
|
7501423b6f | ||
|
|
d0cc3418ea | ||
|
|
5007821c77 | ||
|
|
47c4fa85df | ||
|
|
1cd2f8a538 | ||
|
|
b85d4e6b38 | ||
|
|
dc22dc7cad | ||
|
|
8c05dc87d8 | ||
|
|
884aa17886 | ||
|
|
944e6b78db | ||
|
|
d70fb49aaa | ||
|
|
3726c11433 | ||
|
|
71b40f7024 | ||
|
|
83e5e2517b | ||
|
|
d5c8a0fa27 | ||
|
|
780e24be34 | ||
|
|
ec9716b3cc | ||
|
|
0bc338adab | ||
|
|
5378ea8eca | ||
|
|
b95b593ca5 | ||
|
|
4fedf471b1 | ||
|
|
1b9063ee0e | ||
|
|
d096588f08 | ||
|
|
662b9d91f5 | ||
|
|
a62f530b6f | ||
|
|
2995cdf0a1 | ||
|
|
f10f9c8217 | ||
|
|
c26e6f3aba | ||
|
|
2b08dc18f2 | ||
|
|
412108cd55 | ||
|
|
8fcec1fb58 | ||
|
|
95e747361e | ||
|
|
aad39a371f | ||
|
|
7fe619c58c | ||
|
|
e6fb8f1c5d | ||
|
|
6a942b304d | ||
|
|
340a6b15b5 | ||
|
|
e0c069db55 | ||
|
|
1f7c2c79e0 | ||
|
|
5e8c25d1f5 | ||
|
|
3095d112ef | ||
|
|
16ef1448d7 | ||
|
|
e55409315f | ||
|
|
d4385a64a7 | ||
|
|
ede05b95d7 | ||
|
|
f3c12d5561 | ||
|
|
adb9c4a7f4 | ||
|
|
01f21badd5 | ||
|
|
26f8f84a96 | ||
|
|
433f76091b | ||
|
|
4426b4ea91 | ||
|
|
f522fdf89d | ||
|
|
1e0c16f0dc | ||
|
|
b7a00a3203 | ||
|
|
0827eef58f | ||
|
|
cd9197e9bd | ||
|
|
72447df44c | ||
|
|
59845ec372 | ||
|
|
cb001af8a3 | ||
|
|
4498687c5e | ||
|
|
a10e209c8d | ||
|
|
c02c929c56 | ||
|
|
c649df4b94 | ||
|
|
fb40492b6f | ||
|
|
502e8ce651 | ||
|
|
3f7df8ec5a | ||
|
|
b24632bd80 | ||
|
|
792ec716de | ||
|
|
7ad18fd6bd | ||
|
|
87171e29ca | ||
|
|
a762876d6d | ||
|
|
d89855bb90 | ||
|
|
db1d01308c | ||
|
|
4a272e9053 | ||
|
|
ee1c07d0aa | ||
|
|
c6f1224d30 | ||
|
|
1d403c2fd8 | ||
|
|
65892d5ffe | ||
|
|
8c5f6f2dc5 | ||
|
|
62f5f1885b | ||
|
|
eaf0083ee2 | ||
|
|
c1fb081674 | ||
|
|
df166709a3 | ||
|
|
c5a5de05f6 | ||
|
|
3a128c88c3 | ||
|
|
9cc30cb0d3 | ||
|
|
35d87ab129 | ||
|
|
af3981c955 | ||
|
|
27e5cf2514 | ||
|
|
b050504b2d | ||
|
|
5d0a4af70a | ||
|
|
94f18eb26e | ||
|
|
208dbe2131 | ||
|
|
46174ed573 | ||
|
|
1f087496ca | ||
|
|
8f606682c2 | ||
|
|
928d3e806d | ||
|
|
35ede8fcf0 | ||
|
|
4d31e1048a | ||
|
|
0e321b26f4 | ||
|
|
2d2513915c | ||
|
|
de236da416 | ||
|
|
4dadd612d6 | ||
|
|
54ac2dd012 | ||
|
|
4de30f744e | ||
|
|
27dfd2c41c | ||
|
|
20ed2908f1 | ||
|
|
39d19810a8 | ||
|
|
e2028d43a2 | ||
|
|
267841d7bd | ||
|
|
ab58a59f33 | ||
|
|
a1e6ef3759 | ||
|
|
8616c313a2 | ||
|
|
3ca85474b8 | ||
|
|
6c11d441a5 | ||
|
|
68ab87caa2 | ||
|
|
555b03f6fd | ||
|
|
ab8110fa2f | ||
|
|
5e9ef8532f | ||
|
|
ea4bf4810a | ||
|
|
c3e354da23 | ||
|
|
2ee77e654f | ||
|
|
83baffc3f6 | ||
|
|
19cdd5f210 | ||
|
|
b2557ac90c | ||
|
|
69409b3acd | ||
|
|
9dff82c727 | ||
|
|
d109d9c03e | ||
|
|
4e1912a3c3 | ||
|
|
9da70ffbd7 | ||
|
|
75cdb2c08f | ||
|
|
bb2278e5cf | ||
|
|
77f247b2f3 | ||
|
|
d13839fcf4 | ||
|
|
7e54468896 | ||
|
|
339447c5d3 | ||
|
|
43ce96d373 | ||
|
|
265a5be8bc | ||
|
|
65ee4d33af | ||
|
|
717ba9d9a4 | ||
|
|
01bf918aa5 | ||
|
|
28dbd8ff93 | ||
|
|
7f5921cddd | ||
|
|
89354f6540 | ||
|
|
d399e33060 | ||
|
|
29d342f176 | ||
|
|
72113fe791 | ||
|
|
7b4d9763cc | ||
|
|
26c752f562 | ||
|
|
ac1332a8e2 | ||
|
|
c6c5ef6b8e | ||
|
|
4d1dedf2c7 | ||
|
|
13abc95165 | ||
|
|
ee93b05ee9 | ||
|
|
799f8f5f3d | ||
|
|
201b082ce1 | ||
|
|
49cbbbcd99 | ||
|
|
545e0e6b95 | ||
|
|
c18a7d2f73 | ||
|
|
d14afd7973 | ||
|
|
22a72ac3d7 | ||
|
|
6ca0d9b637 | ||
|
|
650f7c6aa3 | ||
|
|
78af634e7e | ||
|
|
2a8f1c5ddd | ||
|
|
e62c6428e7 | ||
|
|
07e51a445e | ||
|
|
70e5684b1f | ||
|
|
5a62022195 | ||
|
|
8551843690 | ||
|
|
d6694e491d | ||
|
|
7f19a7886a | ||
|
|
6dd369c0e6 | ||
|
|
2a07de1333 | ||
|
|
2e1998fc42 | ||
|
|
b7a914b73b | ||
|
|
6c4e082c18 | ||
|
|
1e69bffbba | ||
|
|
d1aa255c7f | ||
|
|
7298ff3219 | ||
|
|
571d782946 | ||
|
|
ada9e00cda | ||
|
|
faf9cb2ea2 | ||
|
|
ac3a063583 | ||
|
|
7cc96bb976 | ||
|
|
fa6cc53297 | ||
|
|
f299e8ba1e | ||
|
|
1b9927d1c7 | ||
|
|
279e891118 | ||
|
|
340a1033a5 | ||
|
|
50f2977cce | ||
|
|
48a65377c0 | ||
|
|
f003268b32 | ||
|
|
3a33cca851 | ||
|
|
bb6c500939 | ||
|
|
76b6e24aee | ||
|
|
58d14c4ef5 | ||
|
|
7463cf3da6 | ||
|
|
90d9783552 | ||
|
|
7c61054649 | ||
|
|
b28406bd1f | ||
|
|
9517cdf52d | ||
|
|
49927e464a | ||
|
|
3e34f6d19c | ||
|
|
182702d2df | ||
|
|
1db73622df | ||
|
|
56832696fc | ||
|
|
176b40a888 | ||
|
|
4902d3a118 | ||
|
|
04d1a7ec3c | ||
|
|
e1b7e78d60 | ||
|
|
7640cf17c1 | ||
|
|
8d7ed4fb57 | ||
|
|
5afc042a74 | ||
|
|
5e5faf73fc | ||
|
|
361a115e53 | ||
|
|
dddc440d56 | ||
|
|
08d6f14ea8 | ||
|
|
9e63a77e7a | ||
|
|
146143a9b4 | ||
|
|
6635d12ce0 | ||
|
|
dccc3f7f1c | ||
|
|
66d5434f23 | ||
|
|
73100a7f85 | ||
|
|
c6b487124a | ||
|
|
c8466d1fac | ||
|
|
264230c2c5 | ||
|
|
32dbccb77b | ||
|
|
8735a7e2da | ||
|
|
d1df13e178 | ||
|
|
d3d7736bae | ||
|
|
7d18e7aa0d | ||
|
|
e60694077d | ||
|
|
ae38557bb0 | ||
|
|
abb586d71e | ||
|
|
81a73aba8b | ||
|
|
0e8fe8af62 | ||
|
|
29885a805e | ||
|
|
9eb3d3a673 | ||
|
|
6e642f628f | ||
|
|
0159bbe7f2 | ||
|
|
476276bf98 | ||
|
|
d82fd09f99 | ||
|
|
2961d73391 | ||
|
|
eb1cb3649c | ||
|
|
b384fe17ba | ||
|
|
ccb1df45d1 | ||
|
|
5a736647a1 | ||
|
|
918b468a41 | ||
|
|
234761dc05 | ||
|
|
fa1cb5d153 | ||
|
|
e998cf1216 | ||
|
|
2bbbf928ae | ||
|
|
fa06a1eadf | ||
|
|
5eea9e34e7 | ||
|
|
75b5e5376d | ||
|
|
be507421b1 | ||
|
|
5d943d4b7f | ||
|
|
67951b1f2b | ||
|
|
c104cf5dc0 | ||
|
|
4fb4c6ed94 | ||
|
|
df5a794b3d | ||
|
|
c01bc907ed | ||
|
|
222733049e | ||
|
|
fa9db3c8fa | ||
|
|
18a8a22c65 | ||
|
|
425f05e29d | ||
|
|
90fca23920 | ||
|
|
0d3d3bbb40 | ||
|
|
98ce947a6c | ||
|
|
2ed9516172 | ||
|
|
4fc93ec115 | ||
|
|
61d6acdeb1 | ||
|
|
f98ccd1e39 | ||
|
|
7f0a981b2e | ||
|
|
2e7a11c409 | ||
|
|
9ddf153e00 | ||
|
|
f8d95a85df | ||
|
|
59e9d284e9 | ||
|
|
4ce4c767e2 | ||
|
|
a0e6af1e53 | ||
|
|
ef77c9d60b | ||
|
|
8fee77b04b | ||
|
|
b807fc9c54 | ||
|
|
55c7a1e03d | ||
|
|
4799020e28 | ||
|
|
bb420e4681 | ||
|
|
0c735ba79d | ||
|
|
e918bf24ae | ||
|
|
eea6b7f517 | ||
|
|
ff435e591d | ||
|
|
df3315bbea | ||
|
|
b7770574c2 | ||
|
|
29bf378d97 | ||
|
|
68b042febd | ||
|
|
c366a07d62 | ||
|
|
9e5eb95517 | ||
|
|
7f96bd610d | ||
|
|
8f53a1d37f | ||
|
|
37a562b194 | ||
|
|
ad1f156c7c | ||
|
|
6079dea4c4 | ||
|
|
437f2be56d | ||
|
|
97c606b612 | ||
|
|
5a7faf0eb5 | ||
|
|
dcc55dfd04 | ||
|
|
902046e4d8 | ||
|
|
88f7a7bc65 | ||
|
|
6cf4fbcef8 | ||
|
|
7fa864a4f4 | ||
|
|
f77cbc9ef7 | ||
|
|
8a1800c5da | ||
|
|
90894a8853 | ||
|
|
614f27a4fb | ||
|
|
ac84a9bee3 | ||
|
|
4256ea99c5 | ||
|
|
76489f433b | ||
|
|
e9005f7727 | ||
|
|
8d03fb4787 | ||
|
|
d3301c9bc2 | ||
|
|
1e326de474 | ||
|
|
83731e6528 | ||
|
|
a24b9c0184 | ||
|
|
31c555afda | ||
|
|
9dea373bba | ||
|
|
b956d8a4dd | ||
|
|
81d5e48db0 | ||
|
|
bc5b3a85ae | ||
|
|
415c42d27c | ||
|
|
e6c1cd0d8c | ||
|
|
39621898ff | ||
|
|
c500de6dea | ||
|
|
c4f4f5ae07 | ||
|
|
f1d9b4b985 | ||
|
|
d134334a38 | ||
|
|
3b02a6fdc5 | ||
|
|
1fe633e27c | ||
|
|
74bca717aa | ||
|
|
bb4505e078 | ||
|
|
dbfca0275d | ||
|
|
d01372220d | ||
|
|
8e13afa0db | ||
|
|
4e3b068ce1 | ||
|
|
017d757dd4 | ||
|
|
5212cb5ed9 | ||
|
|
58c2878fce | ||
|
|
daf23ba955 | ||
|
|
98f72c3040 | ||
|
|
1852eb2115 | ||
|
|
abe0bd98df | ||
|
|
2ad687a32e | ||
|
|
2f5fb3f92b | ||
|
|
7fd71a5e13 | ||
|
|
b62d4c91b6 |
@@ -43,7 +43,7 @@ Note that before a PR will be accepted, you must ensure:
|
|||||||
1. In a new branch, create a new Lerna package:
|
1. In a new branch, create a new Lerna package:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ npm run create-package new-package
|
$ npm run new-package [name]
|
||||||
```
|
```
|
||||||
|
|
||||||
This will ask you some questions about the new package. Start with `0.0.0` as the first version (look generally at some of the other packages for how the package.json is structured).
|
This will ask you some questions about the new package. Start with `0.0.0` as the first version (look generally at some of the other packages for how the package.json is structured).
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/packages/artifact"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
groups:
|
||||||
|
# Group minor and patch updates together but keep major separate
|
||||||
|
artifact-minor-patch:
|
||||||
|
update-types:
|
||||||
|
- "minor"
|
||||||
|
- "patch"
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/packages/cache"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
groups:
|
||||||
|
# Group minor and patch updates together but keep major separate
|
||||||
|
cache-minor-patch:
|
||||||
|
update-types:
|
||||||
|
- "minor"
|
||||||
|
- "patch"
|
||||||
@@ -22,12 +22,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 24.x
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 24.x
|
||||||
|
|
||||||
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
||||||
# without these to just compile the artifacts package
|
# without these to just compile the artifacts package
|
||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
echo -n 'hello from file 2' > artifact-path/second.txt
|
echo -n 'hello from file 2' > artifact-path/second.txt
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v8
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const {default: artifact} = require('./packages/artifact/lib/artifact')
|
const {default: artifact} = require('./packages/artifact/lib/artifact')
|
||||||
@@ -72,17 +72,17 @@ jobs:
|
|||||||
console.log('Successfully blocked second artifact upload')
|
console.log('Successfully blocked second artifact upload')
|
||||||
}
|
}
|
||||||
verify:
|
verify:
|
||||||
name: Verify
|
name: Verify and Delete
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [upload]
|
needs: [upload]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 24.x
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 24.x
|
||||||
|
|
||||||
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
||||||
# without these to just compile the artifacts package
|
# without these to just compile the artifacts package
|
||||||
@@ -96,7 +96,7 @@ jobs:
|
|||||||
working-directory: packages/artifact
|
working-directory: packages/artifact
|
||||||
|
|
||||||
- name: List and Download Artifacts
|
- name: List and Download Artifacts
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v8
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const {default: artifactClient} = require('./packages/artifact/lib/artifact')
|
const {default: artifactClient} = require('./packages/artifact/lib/artifact')
|
||||||
@@ -164,3 +164,31 @@ jobs:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
- name: Delete Artifacts
|
||||||
|
uses: actions/github-script@v8
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const {default: artifactClient} = require('./packages/artifact/lib/artifact')
|
||||||
|
|
||||||
|
const artifactsToDelete = [
|
||||||
|
'my-artifact-ubuntu-latest',
|
||||||
|
'my-artifact-windows-latest',
|
||||||
|
'my-artifact-macos-latest'
|
||||||
|
]
|
||||||
|
|
||||||
|
for (const artifactName of artifactsToDelete) {
|
||||||
|
const {id} = await artifactClient.deleteArtifact(artifactName)
|
||||||
|
}
|
||||||
|
|
||||||
|
const {artifacts} = await artifactClient.listArtifacts({latest: true})
|
||||||
|
const foundArtifacts = artifacts.filter(artifact =>
|
||||||
|
artifactsToDelete.includes(artifact.name)
|
||||||
|
)
|
||||||
|
|
||||||
|
if (foundArtifacts.length !== 0) {
|
||||||
|
console.log('Unexpected length of found artifacts:', foundArtifacts)
|
||||||
|
throw new Error(
|
||||||
|
`Expected 0 artifacts but found ${foundArtifacts.length} artifacts.`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 24.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 24.x
|
||||||
|
|
||||||
- name: npm install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
run: npm run bootstrap
|
run: npm run bootstrap
|
||||||
|
|
||||||
- name: audit tools (without allow-list)
|
- name: audit tools (without allow-list)
|
||||||
run: npm audit --audit-level=moderate
|
run: npm audit --audit-level=moderate --omit dev
|
||||||
|
|
||||||
- name: audit packages
|
- name: audit packages
|
||||||
run: npm run audit-all
|
run: npm run audit-all
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 24.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 24.x
|
||||||
|
|
||||||
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
||||||
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
||||||
@@ -39,9 +39,11 @@ jobs:
|
|||||||
- name: Install root npm packages
|
- name: Install root npm packages
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
# We need to install only runtime dependencies (omit dev dependencies) to verify that what we're shipping is all
|
||||||
|
# that is needed
|
||||||
- name: Compile cache package
|
- name: Compile cache package
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci --omit=dev
|
||||||
npm run tsc
|
npm run tsc
|
||||||
working-directory: packages/cache
|
working-directory: packages/cache
|
||||||
|
|
||||||
@@ -53,10 +55,8 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: packages/cache/__tests__/create-cache-files.sh ${{ runner.os }} ~/test-cache
|
run: packages/cache/__tests__/create-cache-files.sh ${{ runner.os }} ~/test-cache
|
||||||
|
|
||||||
# We're using node -e to call the functions directly available in the @actions/cache package
|
|
||||||
- name: Save cache using saveCache()
|
- name: Save cache using saveCache()
|
||||||
run: |
|
run: node packages/cache/__tests__/save-cache.mjs ${{ runner.os }} ${{ github.run_id }}
|
||||||
node -e "Promise.resolve(require('./packages/cache/lib/cache').saveCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}'))"
|
|
||||||
|
|
||||||
- name: Delete cache folders before restoring
|
- name: Delete cache folders before restoring
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -65,8 +65,7 @@ jobs:
|
|||||||
rm -rf ~/test-cache
|
rm -rf ~/test-cache
|
||||||
|
|
||||||
- name: Restore cache using restoreCache() with http-client
|
- name: Restore cache using restoreCache() with http-client
|
||||||
run: |
|
run: node packages/cache/__tests__/restore-cache.mjs ${{ runner.os }} ${{ github.run_id }} false
|
||||||
node -e "Promise.resolve(require('./packages/cache/lib/cache').restoreCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}',[],{useAzureSdk: false}))"
|
|
||||||
|
|
||||||
- name: Verify cache restored with http-client
|
- name: Verify cache restored with http-client
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -81,8 +80,7 @@ jobs:
|
|||||||
rm -rf ~/test-cache
|
rm -rf ~/test-cache
|
||||||
|
|
||||||
- name: Restore cache using restoreCache() with Azure SDK
|
- name: Restore cache using restoreCache() with Azure SDK
|
||||||
run: |
|
run: node packages/cache/__tests__/restore-cache.mjs ${{ runner.os }} ${{ github.run_id }} true
|
||||||
node -e "Promise.resolve(require('./packages/cache/lib/cache').restoreCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}'))"
|
|
||||||
|
|
||||||
- name: Verify cache restored with Azure SDK
|
- name: Verify cache restored with Azure SDK
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -17,16 +17,16 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
rm "C:\Program Files\Git\usr\bin\tar.exe"
|
rm "C:\Program Files\Git\usr\bin\tar.exe"
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 24.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 24.x
|
||||||
|
|
||||||
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
||||||
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
||||||
@@ -52,10 +52,8 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: packages/cache/__tests__/create-cache-files.sh ${{ runner.os }} ~/test-cache
|
run: packages/cache/__tests__/create-cache-files.sh ${{ runner.os }} ~/test-cache
|
||||||
|
|
||||||
# We're using node -e to call the functions directly available in the @actions/cache package
|
|
||||||
- name: Save cache using saveCache()
|
- name: Save cache using saveCache()
|
||||||
run: |
|
run: node packages/cache/__tests__/save-cache.mjs ${{ runner.os }} ${{ github.run_id }}
|
||||||
node -e "Promise.resolve(require('./packages/cache/lib/cache').saveCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}'))"
|
|
||||||
|
|
||||||
- name: Delete cache folders before restoring
|
- name: Delete cache folders before restoring
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -64,8 +62,7 @@ jobs:
|
|||||||
rm -rf ~/test-cache
|
rm -rf ~/test-cache
|
||||||
|
|
||||||
- name: Restore cache using restoreCache() with http-client
|
- name: Restore cache using restoreCache() with http-client
|
||||||
run: |
|
run: node packages/cache/__tests__/restore-cache.mjs ${{ runner.os }} ${{ github.run_id }} false
|
||||||
node -e "Promise.resolve(require('./packages/cache/lib/cache').restoreCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}',[],{useAzureSdk: false}))"
|
|
||||||
|
|
||||||
- name: Verify cache restored with http-client
|
- name: Verify cache restored with http-client
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -80,8 +77,7 @@ jobs:
|
|||||||
rm -rf ~/test-cache
|
rm -rf ~/test-cache
|
||||||
|
|
||||||
- name: Restore cache using restoreCache() with Azure SDK
|
- name: Restore cache using restoreCache() with Azure SDK
|
||||||
run: |
|
run: node packages/cache/__tests__/restore-cache.mjs ${{ runner.os }} ${{ github.run_id }} true
|
||||||
node -e "Promise.resolve(require('./packages/cache/lib/cache').restoreCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}'))"
|
|
||||||
|
|
||||||
- name: Verify cache restored with Azure SDK
|
- name: Verify cache restored with Azure SDK
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
|
|||||||
@@ -1,27 +1,42 @@
|
|||||||
name: Publish NPM
|
name: Publish NPM
|
||||||
|
|
||||||
|
run-name: Publish NPM - ${{ github.event.inputs.package }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
package:
|
package:
|
||||||
|
type: choice
|
||||||
required: true
|
required: true
|
||||||
description: 'core, artifact, cache, exec, github, glob, http-client, io, tool-cache'
|
description: 'Which package to release'
|
||||||
|
options:
|
||||||
|
- artifact
|
||||||
|
- attest
|
||||||
|
- cache
|
||||||
|
- core
|
||||||
|
- exec
|
||||||
|
- github
|
||||||
|
- glob
|
||||||
|
- http-client
|
||||||
|
- io
|
||||||
|
- tool-cache
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest-large
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: setup repo
|
- name: setup repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: verify package exists
|
- name: verify package exists
|
||||||
run: ls packages/${{ github.event.inputs.package }}
|
run: ls packages/${{ github.event.inputs.package }}
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set Node.js 24.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 24.x
|
||||||
|
|
||||||
- name: npm install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
@@ -40,29 +55,32 @@ jobs:
|
|||||||
working-directory: packages/${{ github.event.inputs.package }}
|
working-directory: packages/${{ github.event.inputs.package }}
|
||||||
|
|
||||||
- name: upload artifact
|
- name: upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ github.event.inputs.package }}
|
name: ${{ github.event.inputs.package }}
|
||||||
path: packages/${{ github.event.inputs.package }}/*.tgz
|
path: packages/${{ github.event.inputs.package }}/*.tgz
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest-large
|
||||||
needs: test
|
needs: test
|
||||||
environment: npm-publish
|
environment: npm-publish
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Set Node.js 24.x
|
||||||
|
uses: actions/setup-node@v5
|
||||||
|
with:
|
||||||
|
node-version: 24.x
|
||||||
|
|
||||||
- name: download artifact
|
- name: download artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ github.event.inputs.package }}
|
name: ${{ github.event.inputs.package }}
|
||||||
|
|
||||||
- name: setup authentication
|
|
||||||
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
|
|
||||||
env:
|
|
||||||
NPM_TOKEN: ${{ secrets.TOKEN }}
|
|
||||||
|
|
||||||
- name: publish
|
- name: publish
|
||||||
run: npm publish *.tgz
|
run: npm publish --provenance *.tgz
|
||||||
|
|
||||||
- name: notify slack on failure
|
- name: notify slack on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
|
|||||||
@@ -16,19 +16,23 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
runs-on: [ubuntu-latest, macos-latest, windows-latest]
|
runs-on: [ubuntu-latest, macos-latest-large, windows-latest]
|
||||||
|
|
||||||
|
# Node 20 is the currently supported stable Node version for actions - https://docs.github.com/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions#runsusing-for-javascript-actions
|
||||||
|
# Node 24 is the new version being added with support in actions runners
|
||||||
|
node-version: [20.x, 24.x]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Set up Node ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: npm install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
if: ${{ github.repository_owner == 'actions' }}
|
if: ${{ github.repository_owner == 'actions' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
- name: Update Octokit
|
- name: Update Octokit
|
||||||
working-directory: packages/github
|
working-directory: packages/github
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
/packages/artifact/ @actions/artifacts-actions
|
/packages/artifact/ @actions/artifacts-actions
|
||||||
/packages/cache/ @actions/actions-cache
|
/packages/cache/ @actions/actions-cache
|
||||||
|
/packages/attest/ @actions/package-security
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ The GitHub Actions ToolKit provides a set of packages to make creating actions e
|
|||||||
Provides functions for inputs, outputs, results, logging, secrets and variables. Read more [here](packages/core)
|
Provides functions for inputs, outputs, results, logging, secrets and variables. Read more [here](packages/core)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/core
|
npm install @actions/core
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ $ npm install @actions/core
|
|||||||
Provides functions to exec cli tools and process output. Read more [here](packages/exec)
|
Provides functions to exec cli tools and process output. Read more [here](packages/exec)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/exec
|
npm install @actions/exec
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ $ npm install @actions/exec
|
|||||||
Provides functions to search for files matching glob patterns. Read more [here](packages/glob)
|
Provides functions to search for files matching glob patterns. Read more [here](packages/glob)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/glob
|
npm install @actions/glob
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ $ npm install @actions/glob
|
|||||||
A lightweight HTTP client optimized for building actions. Read more [here](packages/http-client)
|
A lightweight HTTP client optimized for building actions. Read more [here](packages/http-client)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/http-client
|
npm install @actions/http-client
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ $ npm install @actions/http-client
|
|||||||
Provides disk i/o functions like cp, mv, rmRF, which etc. Read more [here](packages/io)
|
Provides disk i/o functions like cp, mv, rmRF, which etc. Read more [here](packages/io)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/io
|
npm install @actions/io
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ Provides functions for downloading and caching tools. e.g. setup-* actions. Rea
|
|||||||
See @actions/cache for caching workflow dependencies.
|
See @actions/cache for caching workflow dependencies.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/tool-cache
|
npm install @actions/tool-cache
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ $ npm install @actions/tool-cache
|
|||||||
Provides an Octokit client hydrated with the context that the current action is being run in. Read more [here](packages/github)
|
Provides an Octokit client hydrated with the context that the current action is being run in. Read more [here](packages/github)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/github
|
npm install @actions/github
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ $ npm install @actions/github
|
|||||||
Provides functions to interact with actions artifacts. Read more [here](packages/artifact)
|
Provides functions to interact with actions artifacts. Read more [here](packages/artifact)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/artifact
|
npm install @actions/artifact
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -98,7 +98,16 @@ $ npm install @actions/artifact
|
|||||||
Provides functions to cache dependencies and build outputs to improve workflow execution time. Read more [here](packages/cache)
|
Provides functions to cache dependencies and build outputs to improve workflow execution time. Read more [here](packages/cache)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install @actions/cache
|
npm install @actions/cache
|
||||||
|
```
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
:lock_with_ink_pen: [@actions/attest](packages/attest)
|
||||||
|
|
||||||
|
Provides functions to write attestations for workflow artifacts. Read more [here](packages/attest)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install @actions/attest
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
@@ -218,9 +227,23 @@ console.log(`We can even get context data, like the repo: ${context.repo.repo}`)
|
|||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
## Contributing
|
## Note
|
||||||
|
|
||||||
We welcome contributions. See [how to contribute](.github/CONTRIBUTING.md).
|
Thank you for your interest in this GitHub repo, however, right now we are not taking contributions.
|
||||||
|
|
||||||
|
We continue to focus our resources on strategic areas that help our customers be successful while making developers' lives easier. While GitHub Actions remains a key part of this vision, we are allocating resources towards other areas of Actions and are not taking contributions to this repository at this time. The GitHub public roadmap is the best place to follow along for any updates on features we’re working on and what stage they’re in.
|
||||||
|
|
||||||
|
We are taking the following steps to better direct requests related to GitHub Actions, including:
|
||||||
|
|
||||||
|
1. We will be directing questions and support requests to our [Community Discussions area](https://github.com/orgs/community/discussions/categories/actions)
|
||||||
|
|
||||||
|
2. High Priority bugs can be reported through Community Discussions or you can report these to our support team https://support.github.com/contact/bug-report.
|
||||||
|
|
||||||
|
3. Security Issues should be handled as per our [security.md](SECURITY.md).
|
||||||
|
|
||||||
|
We will still provide security updates for this project and fix major breaking changes during this time.
|
||||||
|
|
||||||
|
You are welcome to still raise bugs in this repo.
|
||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
os: [ubuntu-16.04, windows-2019]
|
os: [ubuntu-16.04, windows-2019]
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
actions:
|
actions:
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
version: ${{matrix.node}}
|
version: ${{matrix.node}}
|
||||||
- run: |
|
- run: |
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ e.g. To use https://github.com/actions/setup-node, users will author:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
using: actions/setup-node@v3
|
using: actions/setup-node@v5
|
||||||
```
|
```
|
||||||
|
|
||||||
# Define Metadata
|
# Define Metadata
|
||||||
|
|||||||
+28
-2
@@ -4,8 +4,34 @@ module.exports = {
|
|||||||
roots: ['<rootDir>/packages'],
|
roots: ['<rootDir>/packages'],
|
||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
testMatch: ['**/__tests__/*.test.ts'],
|
testMatch: ['**/__tests__/*.test.ts'],
|
||||||
transform: {
|
moduleNameMapper: {
|
||||||
'^.+\\.ts$': 'ts-jest'
|
'^(\\.{1,2}/.*)\\.js$': '$1',
|
||||||
|
'^@actions/core$': '<rootDir>/packages/core/lib/core.js',
|
||||||
|
'^@actions/exec$': '<rootDir>/packages/exec/lib/exec.js',
|
||||||
|
'^@actions/io$': '<rootDir>/packages/io/lib/io.js',
|
||||||
|
'^@actions/io/lib/io-util$': '<rootDir>/packages/io/lib/io-util.js',
|
||||||
|
'^@actions/http-client$': '<rootDir>/packages/http-client/lib/index.js',
|
||||||
|
'^@actions/http-client/lib/auth$': '<rootDir>/packages/http-client/lib/auth.js',
|
||||||
|
'^@actions/http-client/lib/interfaces$': '<rootDir>/packages/http-client/lib/interfaces.js',
|
||||||
|
'^@actions/github$': '<rootDir>/packages/github/lib/github.js',
|
||||||
|
'^@actions/github/lib/utils$': '<rootDir>/packages/github/lib/utils.js',
|
||||||
|
'^@actions/glob$': '<rootDir>/packages/glob/lib/glob.js',
|
||||||
|
'^@actions/tool-cache$': '<rootDir>/packages/tool-cache/lib/tool-cache.js',
|
||||||
|
'^@actions/cache$': '<rootDir>/packages/cache/lib/cache.js'
|
||||||
},
|
},
|
||||||
|
transform: {
|
||||||
|
'^.+\\.(ts|js)$': ['ts-jest', {
|
||||||
|
diagnostics: {warnOnly: true},
|
||||||
|
tsconfig: {
|
||||||
|
allowJs: true,
|
||||||
|
esModuleInterop: true,
|
||||||
|
module: 'commonjs',
|
||||||
|
moduleResolution: 'node'
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
transformIgnorePatterns: [
|
||||||
|
'/node_modules/(?!(@octokit|@actions/github|@actions/http-client|@actions/io|@actions/exec|@actions/core|@actions/glob|@actions/tool-cache|@actions/cache|universal-user-agent|before-after-hook)/)'
|
||||||
|
],
|
||||||
verbose: true
|
verbose: true
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+6822
-3441
File diff suppressed because it is too large
Load Diff
+17
-3
@@ -13,11 +13,11 @@
|
|||||||
"lint": "eslint packages/**/*.ts",
|
"lint": "eslint packages/**/*.ts",
|
||||||
"lint-fix": "eslint packages/**/*.ts --fix",
|
"lint-fix": "eslint packages/**/*.ts --fix",
|
||||||
"new-package": "scripts/create-package",
|
"new-package": "scripts/create-package",
|
||||||
"test": "jest --testTimeout 60000"
|
"test": "jest --testTimeout 70000"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.4",
|
"@types/jest": "^29.5.4",
|
||||||
"@types/node": "^20.5.7",
|
"@types/node": "^24.1.0",
|
||||||
"@types/signale": "^1.4.1",
|
"@types/signale": "^1.4.1",
|
||||||
"concurrently": "^6.1.0",
|
"concurrently": "^6.1.0",
|
||||||
"eslint": "^8.0.1",
|
"eslint": "^8.0.1",
|
||||||
@@ -27,10 +27,24 @@
|
|||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"flow-bin": "^0.115.0",
|
"flow-bin": "^0.115.0",
|
||||||
"jest": "^29.6.4",
|
"jest": "^29.6.4",
|
||||||
"lerna": "^7.1.4",
|
"lerna": "^6.4.1",
|
||||||
"nx": "16.6.0",
|
"nx": "16.6.0",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^29.1.1",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"semver": "^7.6.0",
|
||||||
|
"tar": "^6.2.1",
|
||||||
|
"@octokit/plugin-paginate-rest": "^14.0.0",
|
||||||
|
"@octokit/request": "^10.0.7",
|
||||||
|
"@octokit/request-error": "^7.1.0",
|
||||||
|
"@octokit/core": "^7.0.6",
|
||||||
|
"tmp": "^0.2.4",
|
||||||
|
"@types/node": "^24.1.0",
|
||||||
|
"brace-expansion": "^2.0.2",
|
||||||
|
"form-data": "^4.0.4",
|
||||||
|
"uri-js": "npm:uri-js-replace@^1.0.1",
|
||||||
|
"node-fetch": "^3.3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,3 +41,4 @@ Any easy way to test changes for the official upload/download actions is to fork
|
|||||||
1. In the locally cloned fork, link to your local toolkit changes: `npm link @actions/artifact`
|
1. In the locally cloned fork, link to your local toolkit changes: `npm link @actions/artifact`
|
||||||
2. Then, compile your changes with: `npm run release`. The local `dist/index.js` should be updated with your changes.
|
2. Then, compile your changes with: `npm run release`. The local `dist/index.js` should be updated with your changes.
|
||||||
3. Commit and push to your fork, you can then test with a `uses:` in your workflow pointed at your fork.
|
3. Commit and push to your fork, you can then test with a `uses:` in your workflow pointed at your fork.
|
||||||
|
4. The format for the above is `<username>/<repository-name>/@<ref>`, i.e. `me/myrepo/@HEAD`
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ Interact programmatically with [Actions Artifacts](https://docs.github.com/en/ac
|
|||||||
|
|
||||||
This is the core library that powers the [`@actions/upload-artifact`](https://github.com/actions/upload-artifact) and [`@actions/download-artifact`](https://github.com/actions/download-artifact) actions.
|
This is the core library that powers the [`@actions/upload-artifact`](https://github.com/actions/upload-artifact) and [`@actions/download-artifact`](https://github.com/actions/download-artifact) actions.
|
||||||
|
|
||||||
|
|
||||||
- [`@actions/artifact`](#actionsartifact)
|
- [`@actions/artifact`](#actionsartifact)
|
||||||
- [v2 - What's New](#v2---whats-new)
|
- [v2 - What's New](#v2---whats-new)
|
||||||
- [Improvements](#improvements)
|
- [Improvements](#improvements)
|
||||||
@@ -12,6 +11,7 @@ This is the core library that powers the [`@actions/upload-artifact`](https://gi
|
|||||||
- [Quick Start](#quick-start)
|
- [Quick Start](#quick-start)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Upload and Download](#upload-and-download)
|
- [Upload and Download](#upload-and-download)
|
||||||
|
- [Delete an Artifact](#delete-an-artifact)
|
||||||
- [Downloading from other workflow runs or repos](#downloading-from-other-workflow-runs-or-repos)
|
- [Downloading from other workflow runs or repos](#downloading-from-other-workflow-runs-or-repos)
|
||||||
- [Speeding up large uploads](#speeding-up-large-uploads)
|
- [Speeding up large uploads](#speeding-up-large-uploads)
|
||||||
- [Additional Resources](#additional-resources)
|
- [Additional Resources](#additional-resources)
|
||||||
@@ -106,6 +106,41 @@ const {downloadPath} = await artifact.downloadArtifact(id, {
|
|||||||
console.log(`Downloaded artifact ${id} to: ${downloadPath}`)
|
console.log(`Downloaded artifact ${id} to: ${downloadPath}`)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Delete an Artifact
|
||||||
|
|
||||||
|
To delete an artifact, all you need is the name.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const {id} = await artifact.deleteArtifact(
|
||||||
|
// name of the artifact
|
||||||
|
'my-artifact'
|
||||||
|
)
|
||||||
|
|
||||||
|
console.log(`Deleted Artifact ID '${id}'`)
|
||||||
|
```
|
||||||
|
|
||||||
|
It also supports options to delete from other repos/runs given a github token with `actions:write` permissions on the target repository is supplied.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const findBy = {
|
||||||
|
// must have actions:write permission on target repository
|
||||||
|
token: process.env['GITHUB_TOKEN'],
|
||||||
|
workflowRunId: 123,
|
||||||
|
repositoryOwner: 'actions',
|
||||||
|
repositoryName: 'toolkit'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const {id} = await artifact.deleteArtifact(
|
||||||
|
// name of the artifact
|
||||||
|
'my-artifact',
|
||||||
|
// options to find by other repo/owner
|
||||||
|
{ findBy }
|
||||||
|
)
|
||||||
|
|
||||||
|
console.log(`Deleted Artifact ID '${id}' from ${findBy.repositoryOwner}/ ${findBy.repositoryName}`)
|
||||||
|
```
|
||||||
|
|
||||||
### Downloading from other workflow runs or repos
|
### Downloading from other workflow runs or repos
|
||||||
|
|
||||||
It may be useful to download Artifacts from other workflow runs, or even other repositories. By default, the permissions are scoped so they can only download Artifacts within the current workflow run. To elevate permissions for this scenario, you must specify `options.findBy` to `downloadArtifact`.
|
It may be useful to download Artifacts from other workflow runs, or even other repositories. By default, the permissions are scoped so they can only download Artifacts within the current workflow run. To elevate permissions for this scenario, you must specify `options.findBy` to `downloadArtifact`.
|
||||||
|
|||||||
+158
-55
@@ -1,68 +1,144 @@
|
|||||||
# @actions/artifact Releases
|
# @actions/artifact Releases
|
||||||
|
|
||||||
### 0.1.0
|
## 5.0.3
|
||||||
|
|
||||||
- Initial release
|
- Bump `@actions/http-client` to `3.0.2`
|
||||||
|
|
||||||
### 0.2.0
|
## 5.0.1
|
||||||
|
|
||||||
- Fixes to TCP connections not closing
|
- Fix Node.js 24 punycode deprecation warning by updating `@azure/storage-blob` from `^12.15.0` to `^12.29.1` [#2211](https://github.com/actions/toolkit/pull/2211)
|
||||||
- GZip file compression to speed up downloads
|
- Removed direct `@azure/core-http` dependency (now uses `@azure/core-rest-pipeline` via storage-blob)
|
||||||
- Improved logging and output
|
|
||||||
- Extra documentation
|
|
||||||
|
|
||||||
### 0.3.0
|
## 5.0.0
|
||||||
|
|
||||||
- Fixes to gzip decompression when downloading artifacts
|
- Dependency updates for Node.js 24 runtime support
|
||||||
- Support handling 429 response codes
|
- Update `@actions/core` to v2
|
||||||
- Improved download experience when dealing with empty files
|
- Update `@actions/http-client` to v3
|
||||||
- Exponential backoff when retryable status codes are encountered
|
|
||||||
- Clearer error message if storage quota has been reached
|
|
||||||
- Improved logging and output during artifact download
|
|
||||||
|
|
||||||
### 0.3.1
|
## 4.0.0
|
||||||
|
|
||||||
- Fix to ensure temporary gzip files get correctly deleted during artifact upload
|
- Add support for Node 24 [#2110](https://github.com/actions/toolkit/pull/2110)
|
||||||
- Remove spaces as a forbidden character during upload
|
- Fix: artifact pagination bugs and configurable artifact count limits [#2165](https://github.com/actions/toolkit/pull/2165)
|
||||||
|
- Fix: reject the promise on timeout [#2124](https://github.com/actions/toolkit/pull/2124)
|
||||||
|
- Update dependency versions
|
||||||
|
|
||||||
### 0.3.2
|
## 2.3.3
|
||||||
|
|
||||||
- Fix to ensure readstreams get correctly reset in the event of a retry
|
- Dependency updates [#2049](https://github.com/actions/toolkit/pull/2049)
|
||||||
|
|
||||||
### 0.3.3
|
## 2.3.2
|
||||||
|
|
||||||
- Increase chunk size during upload from 4MB to 8MB
|
- Added masking for Shared Access Signature (SAS) artifact URLs [#1982](https://github.com/actions/toolkit/pull/1982)
|
||||||
- Improve user-agent strings during API calls to help internally diagnose issues
|
- Change hash to digest for consistent terminology across runner logs [#1991](https://github.com/actions/toolkit/pull/1991)
|
||||||
|
|
||||||
### 0.3.5
|
## 2.3.1
|
||||||
|
|
||||||
- Retry in the event of a 413 response
|
- Fix comment typo on expectedHash. [#1986](https://github.com/actions/toolkit/pull/1986)
|
||||||
|
|
||||||
### 0.4.0
|
## 2.3.0
|
||||||
|
|
||||||
- Add option to specify custom retentions on artifacts
|
- Allow ArtifactClient to perform digest comparisons, if supplied. [#1975](https://github.com/actions/toolkit/pull/1975)
|
||||||
|
|
||||||
### 0.4.1
|
## 2.2.2
|
||||||
|
|
||||||
- Update to latest @actions/core version
|
- Default concurrency to 5 for uploading artifacts [#1962](https://github.com/actions/toolkit/pull/1962)
|
||||||
|
|
||||||
### 0.4.2
|
## 2.2.1
|
||||||
|
|
||||||
- Improved retry-ability when a partial artifact download is encountered
|
- Add `ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY` and `ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS` environment variables [#1928](https://github.com/actions/toolkit/pull/1928)
|
||||||
|
|
||||||
### 0.5.0
|
## 2.2.0
|
||||||
|
|
||||||
- Improved retry-ability for all http calls during artifact upload and download if an error is encountered
|
- Return artifact digest on upload [#1896](https://github.com/actions/toolkit/pull/1896)
|
||||||
|
|
||||||
### 0.5.1
|
## 2.1.11
|
||||||
|
|
||||||
- Bump @actions/http-client to version 1.0.11 to fix proxy related issues during artifact upload and download
|
- Fixed a bug with relative symlinks resolution [#1844](https://github.com/actions/toolkit/pull/1844)
|
||||||
|
- Use native `crypto` [#1815](https://github.com/actions/toolkit/pull/1815)
|
||||||
|
|
||||||
### 0.5.2
|
## 2.1.10
|
||||||
|
|
||||||
- Add HTTP 500 as a retryable status code for artifact upload and download.
|
- Fixed a regression with symlinks not being automatically resolved [#1830](https://github.com/actions/toolkit/pull/1830)
|
||||||
|
- Fixed a regression with chunk timeout [#1786](https://github.com/actions/toolkit/pull/1786)
|
||||||
|
|
||||||
### 0.6.0
|
## 2.1.9
|
||||||
|
|
||||||
|
- Fixed artifact upload chunk timeout logic [#1774](https://github.com/actions/toolkit/pull/1774)
|
||||||
|
- Use lazy stream to prevent issues with open file limits [#1771](https://github.com/actions/toolkit/pull/1771)
|
||||||
|
|
||||||
|
## 2.1.8
|
||||||
|
|
||||||
|
- Allows `*.localhost` domains for hostname checks for local development.
|
||||||
|
|
||||||
|
## 2.1.7
|
||||||
|
|
||||||
|
- Update unzip-stream dependency and reverted to using `unzip.Extract()`
|
||||||
|
|
||||||
|
## 2.1.6
|
||||||
|
|
||||||
|
- Will retry on invalid request responses.
|
||||||
|
|
||||||
|
## 2.1.5
|
||||||
|
|
||||||
|
- Bumped `archiver` dependency to 7.0.1
|
||||||
|
|
||||||
|
## 2.1.4
|
||||||
|
|
||||||
|
- Adds info-level logging for zip extraction
|
||||||
|
|
||||||
|
## 2.1.3
|
||||||
|
|
||||||
|
- Fixes a bug in the extract logic updated in 2.1.2
|
||||||
|
|
||||||
|
## 2.1.2
|
||||||
|
|
||||||
|
- Updated the stream extract functionality to use `unzip.Parse()` instead of `unzip.Extract()` for greater control of unzipping artifacts
|
||||||
|
|
||||||
|
## 2.1.1
|
||||||
|
|
||||||
|
- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts
|
||||||
|
|
||||||
|
## 2.1.0
|
||||||
|
|
||||||
|
- Added `ArtifactClient#deleteArtifact` to delete artifacts by name [#1626](https://github.com/actions/toolkit/pull/1626)
|
||||||
|
- Update error messaging to be more useful [#1628](https://github.com/actions/toolkit/pull/1628)
|
||||||
|
|
||||||
|
## 2.0.1
|
||||||
|
|
||||||
|
- Patch to fix transient request timeouts <https://github.com/actions/download-artifact/issues/249>
|
||||||
|
|
||||||
|
## 2.0.0
|
||||||
|
|
||||||
|
- Major release. Supports new Artifact backend for improved speed, reliability and behavior.
|
||||||
|
- Numerous API changes, [some breaking](./README.md#breaking-changes).
|
||||||
|
|
||||||
|
- [Blog post with more info](https://github.blog/2024-02-12-get-started-with-v4-of-github-actions-artifacts/)
|
||||||
|
|
||||||
|
## 1.1.1
|
||||||
|
|
||||||
|
- Fixed a bug in Node16 where if an HTTP download finished too quickly (<1ms, e.g. when it's mocked) we attempt to delete a temp file that has not been created yet [#1278](https://github.com/actions/toolkit/pull/1278/commits/b9de68a590daf37c6747e38d3cb4f1dd2cfb791c)
|
||||||
|
|
||||||
|
## 1.1.0
|
||||||
|
|
||||||
|
- Add `x-actions-results-crc64` and `x-actions-results-md5` checksum headers on upload [#1063](https://github.com/actions/toolkit/pull/1063)
|
||||||
|
|
||||||
|
## 1.0.2
|
||||||
|
|
||||||
|
- Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087)
|
||||||
|
|
||||||
|
## 1.0.1
|
||||||
|
|
||||||
|
- Update to v2.0.0 of `@actions/http-client`
|
||||||
|
|
||||||
|
## 1.0.0
|
||||||
|
|
||||||
|
- Update `lockfileVersion` to `v2` in `package-lock.json` [#1009](https://github.com/actions/toolkit/pull/1009)
|
||||||
|
|
||||||
|
## 0.6.1
|
||||||
|
|
||||||
|
- Fix for failing 0 byte file uploads on Windows [#962](https://github.com/actions/toolkit/pull/962)
|
||||||
|
|
||||||
|
## 0.6.0
|
||||||
|
|
||||||
- Support upload from named pipes [#748](https://github.com/actions/toolkit/pull/748)
|
- Support upload from named pipes [#748](https://github.com/actions/toolkit/pull/748)
|
||||||
- Fixes to percentage values being greater than 100% when downloading all artifacts [#889](https://github.com/actions/toolkit/pull/889)
|
- Fixes to percentage values being greater than 100% when downloading all artifacts [#889](https://github.com/actions/toolkit/pull/889)
|
||||||
@@ -71,37 +147,64 @@
|
|||||||
- Faster upload speeds for certain types of large files by exempting gzip compression [#956](https://github.com/actions/toolkit/pull/956)
|
- Faster upload speeds for certain types of large files by exempting gzip compression [#956](https://github.com/actions/toolkit/pull/956)
|
||||||
- More detailed logging when dealing with chunked uploads [#957](https://github.com/actions/toolkit/pull/957)
|
- More detailed logging when dealing with chunked uploads [#957](https://github.com/actions/toolkit/pull/957)
|
||||||
|
|
||||||
### 0.6.1
|
## 0.5.2
|
||||||
|
|
||||||
- Fix for failing 0 byte file uploads on Windows [#962](https://github.com/actions/toolkit/pull/962)
|
- Add HTTP 500 as a retryable status code for artifact upload and download.
|
||||||
|
|
||||||
### 1.0.0
|
## 0.5.1
|
||||||
|
|
||||||
- Update `lockfileVersion` to `v2` in `package-lock.json` [#1009](https://github.com/actions/toolkit/pull/1009)
|
- Bump @actions/http-client to version 1.0.11 to fix proxy related issues during artifact upload and download
|
||||||
|
|
||||||
### 1.0.1
|
## 0.5.0
|
||||||
|
|
||||||
- Update to v2.0.0 of `@actions/http-client`
|
- Improved retry-ability for all http calls during artifact upload and download if an error is encountered
|
||||||
|
|
||||||
### 1.0.2
|
## 0.4.2
|
||||||
|
|
||||||
- Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087)
|
- Improved retry-ability when a partial artifact download is encountered
|
||||||
|
|
||||||
### 1.1.0
|
## 0.4.1
|
||||||
|
|
||||||
- Add `x-actions-results-crc64` and `x-actions-results-md5` checksum headers on upload [#1063](https://github.com/actions/toolkit/pull/1063)
|
- Update to latest @actions/core version
|
||||||
|
|
||||||
### 1.1.1
|
## 0.4.0
|
||||||
|
|
||||||
- Fixed a bug in Node16 where if an HTTP download finished too quickly (<1ms, e.g. when it's mocked) we attempt to delete a temp file that has not been created yet [#1278](https://github.com/actions/toolkit/pull/1278/commits/b9de68a590daf37c6747e38d3cb4f1dd2cfb791c)
|
- Add option to specify custom retentions on artifacts
|
||||||
|
|
||||||
### 2.0.0
|
## 0.3.5
|
||||||
|
|
||||||
- Major release. Supports new Artifact backend for improved speed, reliability and behavior.
|
- Retry in the event of a 413 response
|
||||||
- Numerous API changes, [some breaking](./README.md#breaking-changes).
|
|
||||||
|
|
||||||
- Blog post with more info: TBD
|
## 0.3.3
|
||||||
|
|
||||||
### 2.0.1
|
- Increase chunk size during upload from 4MB to 8MB
|
||||||
|
- Improve user-agent strings during API calls to help internally diagnose issues
|
||||||
|
|
||||||
- Patch to fix transient request timeouts https://github.com/actions/download-artifact/issues/249
|
## 0.3.2
|
||||||
|
|
||||||
|
- Fix to ensure readstreams get correctly reset in the event of a retry
|
||||||
|
|
||||||
|
## 0.3.1
|
||||||
|
|
||||||
|
- Fix to ensure temporary gzip files get correctly deleted during artifact upload
|
||||||
|
- Remove spaces as a forbidden character during upload
|
||||||
|
|
||||||
|
## 0.3.0
|
||||||
|
|
||||||
|
- Fixes to gzip decompression when downloading artifacts
|
||||||
|
- Support handling 429 response codes
|
||||||
|
- Improved download experience when dealing with empty files
|
||||||
|
- Exponential backoff when retryable status codes are encountered
|
||||||
|
- Clearer error message if storage quota has been reached
|
||||||
|
- Improved logging and output during artifact download
|
||||||
|
|
||||||
|
## 0.2.0
|
||||||
|
|
||||||
|
- Fixes to TCP connections not closing
|
||||||
|
- GZip file compression to speed up downloads
|
||||||
|
- Improved logging and output
|
||||||
|
- Extra documentation
|
||||||
|
|
||||||
|
## 0.1.0
|
||||||
|
|
||||||
|
- Initial release
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as http from 'http'
|
import * as http from 'http'
|
||||||
import * as net from 'net'
|
import * as net from 'net'
|
||||||
import {HttpClient} from '@actions/http-client'
|
import {HttpClient} from '@actions/http-client'
|
||||||
import * as config from '../src/internal/shared/config'
|
import * as config from '../src/internal/shared/config.js'
|
||||||
import {internalArtifactTwirpClient} from '../src/internal/shared/artifact-twirp-client'
|
import {internalArtifactTwirpClient} from '../src/internal/shared/artifact-twirp-client.js'
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common.js'
|
||||||
import {NetworkError, UsageError} from '../src/internal/shared/errors'
|
import {NetworkError, UsageError} from '../src/internal/shared/errors.js'
|
||||||
|
|
||||||
jest.mock('@actions/http-client')
|
jest.mock('@actions/http-client')
|
||||||
|
|
||||||
@@ -116,6 +116,54 @@ describe('artifact-http-client', () => {
|
|||||||
expect(mockPost).toHaveBeenCalledTimes(2)
|
expect(mockPost).toHaveBeenCalledTimes(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should retry if invalid body response', async () => {
|
||||||
|
const mockPost = jest
|
||||||
|
.fn(() => {
|
||||||
|
const msgSucceeded = new http.IncomingMessage(new net.Socket())
|
||||||
|
msgSucceeded.statusCode = 200
|
||||||
|
return {
|
||||||
|
message: msgSucceeded,
|
||||||
|
readBody: async () => {
|
||||||
|
return Promise.resolve(
|
||||||
|
`{"ok": true, "signedUploadUrl": "http://localhost:8080/upload"}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.mockImplementationOnce(() => {
|
||||||
|
const msgFailed = new http.IncomingMessage(new net.Socket())
|
||||||
|
msgFailed.statusCode = 502
|
||||||
|
msgFailed.statusMessage = 'Bad Gateway'
|
||||||
|
return {
|
||||||
|
message: msgFailed,
|
||||||
|
readBody: async () => {
|
||||||
|
return Promise.resolve('💥')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const mockHttpClient = (
|
||||||
|
HttpClient as unknown as jest.Mock
|
||||||
|
).mockImplementation(() => {
|
||||||
|
return {
|
||||||
|
post: mockPost
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const client = internalArtifactTwirpClient(clientOptions)
|
||||||
|
const artifact = await client.CreateArtifact({
|
||||||
|
workflowRunBackendId: '1234',
|
||||||
|
workflowJobRunBackendId: '5678',
|
||||||
|
name: 'artifact',
|
||||||
|
version: 4
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledTimes(1)
|
||||||
|
expect(artifact).toBeDefined()
|
||||||
|
expect(artifact.ok).toBe(true)
|
||||||
|
expect(artifact.signedUploadUrl).toBe('http://localhost:8080/upload')
|
||||||
|
expect(mockPost).toHaveBeenCalledTimes(2)
|
||||||
|
})
|
||||||
|
|
||||||
it('should fail if the request fails 5 times', async () => {
|
it('should fail if the request fails 5 times', async () => {
|
||||||
const mockPost = jest.fn(() => {
|
const mockPost = jest.fn(() => {
|
||||||
const msgFailed = new http.IncomingMessage(new net.Socket())
|
const msgFailed = new http.IncomingMessage(new net.Socket())
|
||||||
|
|||||||
@@ -0,0 +1,149 @@
|
|||||||
|
import * as config from '../src/internal/shared/config.js'
|
||||||
|
import os from 'os'
|
||||||
|
|
||||||
|
// Mock the `cpus()` function in the `os` module
|
||||||
|
jest.mock('os', () => {
|
||||||
|
const osActual = jest.requireActual('os')
|
||||||
|
return {
|
||||||
|
...osActual,
|
||||||
|
cpus: jest.fn()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.resetModules()
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('isGhes', () => {
|
||||||
|
it('should return false when the request domain is github.com', () => {
|
||||||
|
process.env.GITHUB_SERVER_URL = 'https://github.com'
|
||||||
|
expect(config.isGhes()).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should return false when the request domain ends with ghe.com', () => {
|
||||||
|
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.com'
|
||||||
|
expect(config.isGhes()).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should return false when the request domain ends with ghe.localhost', () => {
|
||||||
|
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost'
|
||||||
|
expect(config.isGhes()).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should return false when the request domain ends with .localhost', () => {
|
||||||
|
process.env.GITHUB_SERVER_URL = 'https://github.localhost'
|
||||||
|
expect(config.isGhes()).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should return false when the request domain is specific to an enterprise', () => {
|
||||||
|
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
|
||||||
|
expect(config.isGhes()).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('uploadChunkTimeoutEnv', () => {
|
||||||
|
it('should return default 300000 when no env set', () => {
|
||||||
|
expect(config.getUploadChunkTimeout()).toBe(300000)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should return value set in ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS', () => {
|
||||||
|
process.env.ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS = '150000'
|
||||||
|
expect(config.getUploadChunkTimeout()).toBe(150000)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw if value set in ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS is invalid', () => {
|
||||||
|
process.env.ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS = 'abc'
|
||||||
|
expect(() => {
|
||||||
|
config.getUploadChunkTimeout()
|
||||||
|
}).toThrow()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('uploadConcurrencyEnv', () => {
|
||||||
|
it('Concurrency default to 5', () => {
|
||||||
|
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||||
|
expect(config.getConcurrency()).toBe(5)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Concurrency max out at 300 on systems with many CPUs', () => {
|
||||||
|
;(os.cpus as jest.Mock).mockReturnValue(new Array(32))
|
||||||
|
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = '301'
|
||||||
|
expect(config.getConcurrency()).toBe(300)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Concurrency can be set to 32 when cpu num is <= 4', () => {
|
||||||
|
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||||
|
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = '32'
|
||||||
|
expect(config.getConcurrency()).toBe(32)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Concurrency can be set 16 * num of cpu when cpu num is > 4', () => {
|
||||||
|
;(os.cpus as jest.Mock).mockReturnValue(new Array(6))
|
||||||
|
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = '96'
|
||||||
|
expect(config.getConcurrency()).toBe(96)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Concurrency can be overridden by env var ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY', () => {
|
||||||
|
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||||
|
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = '10'
|
||||||
|
expect(config.getConcurrency()).toBe(10)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw with invalid value of ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY', () => {
|
||||||
|
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||||
|
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = 'abc'
|
||||||
|
expect(() => {
|
||||||
|
config.getConcurrency()
|
||||||
|
}).toThrow()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw if ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY is < 1', () => {
|
||||||
|
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||||
|
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = '0'
|
||||||
|
expect(() => {
|
||||||
|
config.getConcurrency()
|
||||||
|
}).toThrow()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('getMaxArtifactListCount', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
delete process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should return default 1000 when no env set', () => {
|
||||||
|
expect(config.getMaxArtifactListCount()).toBe(1000)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should return value set in ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT', () => {
|
||||||
|
process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT = '2000'
|
||||||
|
expect(config.getMaxArtifactListCount()).toBe(2000)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw if value set in ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT is invalid', () => {
|
||||||
|
process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT = 'abc'
|
||||||
|
expect(() => {
|
||||||
|
config.getMaxArtifactListCount()
|
||||||
|
}).toThrow(
|
||||||
|
'Invalid value set for ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT env variable'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw if ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT is < 1', () => {
|
||||||
|
process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT = '0'
|
||||||
|
expect(() => {
|
||||||
|
config.getMaxArtifactListCount()
|
||||||
|
}).toThrow(
|
||||||
|
'Invalid value set for ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT env variable'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw if ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT is negative', () => {
|
||||||
|
process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT = '-100'
|
||||||
|
expect(() => {
|
||||||
|
config.getMaxArtifactListCount()
|
||||||
|
}).toThrow(
|
||||||
|
'Invalid value set for ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT env variable'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
import * as github from '@actions/github'
|
||||||
|
import type {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types'
|
||||||
|
import type {RequestInterface} from '@octokit/types'
|
||||||
|
import {
|
||||||
|
deleteArtifactInternal,
|
||||||
|
deleteArtifactPublic
|
||||||
|
} from '../src/internal/delete/delete-artifact.js'
|
||||||
|
import * as config from '../src/internal/shared/config.js'
|
||||||
|
import {ArtifactServiceClientJSON, Timestamp} from '../src/generated/index.js'
|
||||||
|
import * as util from '../src/internal/shared/util.js'
|
||||||
|
import {noopLogs} from './common.js'
|
||||||
|
|
||||||
|
type MockedRequest = jest.MockedFunction<RequestInterface<object>>
|
||||||
|
|
||||||
|
type MockedDeleteArtifact = jest.MockedFunction<
|
||||||
|
RestEndpointMethods['actions']['deleteArtifact']
|
||||||
|
>
|
||||||
|
|
||||||
|
jest.mock('@actions/github', () => ({
|
||||||
|
getOctokit: jest.fn().mockReturnValue({
|
||||||
|
request: jest.fn(),
|
||||||
|
rest: {
|
||||||
|
actions: {
|
||||||
|
deleteArtifact: jest.fn()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}))
|
||||||
|
|
||||||
|
const fixtures = {
|
||||||
|
repo: 'toolkit',
|
||||||
|
owner: 'actions',
|
||||||
|
token: 'ghp_1234567890',
|
||||||
|
runId: 123,
|
||||||
|
backendIds: {
|
||||||
|
workflowRunBackendId: 'c4d7c21f-ba3f-4ddc-a8c8-6f2f626f8422',
|
||||||
|
workflowJobRunBackendId: '760803a1-f890-4d25-9a6e-a3fc01a0c7cf'
|
||||||
|
},
|
||||||
|
artifacts: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: 'my-artifact',
|
||||||
|
size: 456,
|
||||||
|
createdAt: new Date('2023-12-01')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: 'my-artifact',
|
||||||
|
size: 456,
|
||||||
|
createdAt: new Date('2023-12-02')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('delete-artifact', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
noopLogs()
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('public', () => {
|
||||||
|
it('should delete an artifact', async () => {
|
||||||
|
const mockRequest = github.getOctokit(fixtures.token)
|
||||||
|
.request as MockedRequest
|
||||||
|
mockRequest.mockResolvedValueOnce({
|
||||||
|
status: 200,
|
||||||
|
headers: {},
|
||||||
|
url: '',
|
||||||
|
data: {
|
||||||
|
artifacts: [
|
||||||
|
{
|
||||||
|
name: fixtures.artifacts[0].name,
|
||||||
|
id: fixtures.artifacts[0].id,
|
||||||
|
size_in_bytes: fixtures.artifacts[0].size,
|
||||||
|
created_at: fixtures.artifacts[0].createdAt.toISOString()
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const mockDeleteArtifact = github.getOctokit(fixtures.token).rest.actions
|
||||||
|
.deleteArtifact as MockedDeleteArtifact
|
||||||
|
mockDeleteArtifact.mockResolvedValueOnce({
|
||||||
|
status: 204,
|
||||||
|
headers: {},
|
||||||
|
url: '',
|
||||||
|
data: null as never
|
||||||
|
})
|
||||||
|
|
||||||
|
const response = await deleteArtifactPublic(
|
||||||
|
fixtures.artifacts[0].name,
|
||||||
|
fixtures.runId,
|
||||||
|
fixtures.owner,
|
||||||
|
fixtures.repo,
|
||||||
|
fixtures.token
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(response).toEqual({
|
||||||
|
id: fixtures.artifacts[0].id
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should fail if non-200 response', async () => {
|
||||||
|
const mockRequest = github.getOctokit(fixtures.token)
|
||||||
|
.request as MockedRequest
|
||||||
|
mockRequest.mockResolvedValueOnce({
|
||||||
|
status: 200,
|
||||||
|
headers: {},
|
||||||
|
url: '',
|
||||||
|
data: {
|
||||||
|
artifacts: [
|
||||||
|
{
|
||||||
|
name: fixtures.artifacts[0].name,
|
||||||
|
id: fixtures.artifacts[0].id,
|
||||||
|
size_in_bytes: fixtures.artifacts[0].size,
|
||||||
|
created_at: fixtures.artifacts[0].createdAt.toISOString()
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const mockDeleteArtifact = github.getOctokit(fixtures.token).rest.actions
|
||||||
|
.deleteArtifact as MockedDeleteArtifact
|
||||||
|
mockDeleteArtifact.mockRejectedValue(new Error('boom'))
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
deleteArtifactPublic(
|
||||||
|
fixtures.artifacts[0].name,
|
||||||
|
fixtures.runId,
|
||||||
|
fixtures.owner,
|
||||||
|
fixtures.repo,
|
||||||
|
fixtures.token
|
||||||
|
)
|
||||||
|
).rejects.toThrow('boom')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('internal', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
||||||
|
jest
|
||||||
|
.spyOn(util, 'getBackendIdsFromToken')
|
||||||
|
.mockReturnValue(fixtures.backendIds)
|
||||||
|
jest
|
||||||
|
.spyOn(config, 'getResultsServiceUrl')
|
||||||
|
.mockReturnValue('https://results.local')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should delete an artifact', async () => {
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts')
|
||||||
|
.mockResolvedValue({
|
||||||
|
artifacts: fixtures.artifacts.map(artifact => ({
|
||||||
|
...fixtures.backendIds,
|
||||||
|
databaseId: artifact.id.toString(),
|
||||||
|
name: artifact.name,
|
||||||
|
size: artifact.size.toString(),
|
||||||
|
createdAt: Timestamp.fromDate(artifact.createdAt)
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'DeleteArtifact')
|
||||||
|
.mockResolvedValue({
|
||||||
|
ok: true,
|
||||||
|
artifactId: fixtures.artifacts[0].id.toString()
|
||||||
|
})
|
||||||
|
const response = await deleteArtifactInternal(fixtures.artifacts[0].name)
|
||||||
|
expect(response).toEqual({
|
||||||
|
id: fixtures.artifacts[0].id
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should fail if non-200 response', async () => {
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts')
|
||||||
|
.mockResolvedValue({
|
||||||
|
artifacts: fixtures.artifacts.map(artifact => ({
|
||||||
|
...fixtures.backendIds,
|
||||||
|
databaseId: artifact.id.toString(),
|
||||||
|
name: artifact.name,
|
||||||
|
size: artifact.size.toString(),
|
||||||
|
createdAt: Timestamp.fromDate(artifact.createdAt)
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'DeleteArtifact')
|
||||||
|
.mockRejectedValue(new Error('boom'))
|
||||||
|
await expect(
|
||||||
|
deleteArtifactInternal(fixtures.artifacts[0].id)
|
||||||
|
).rejects.toThrow('boom')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -11,12 +11,12 @@ import {
|
|||||||
downloadArtifactInternal,
|
downloadArtifactInternal,
|
||||||
downloadArtifactPublic,
|
downloadArtifactPublic,
|
||||||
streamExtractExternal
|
streamExtractExternal
|
||||||
} from '../src/internal/download/download-artifact'
|
} from '../src/internal/download/download-artifact.js'
|
||||||
import {getUserAgentString} from '../src/internal/shared/user-agent'
|
import {getUserAgentString} from '../src/internal/shared/user-agent.js'
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common.js'
|
||||||
import * as config from '../src/internal/shared/config'
|
import * as config from '../src/internal/shared/config.js'
|
||||||
import {ArtifactServiceClientJSON} from '../src/generated'
|
import {ArtifactServiceClientJSON} from '../src/generated/index.js'
|
||||||
import * as util from '../src/internal/shared/util'
|
import * as util from '../src/internal/shared/util.js'
|
||||||
|
|
||||||
type MockedDownloadArtifact = jest.MockedFunction<
|
type MockedDownloadArtifact = jest.MockedFunction<
|
||||||
RestEndpointMethods['actions']['downloadArtifact']
|
RestEndpointMethods['actions']['downloadArtifact']
|
||||||
@@ -111,6 +111,16 @@ const mockGetArtifactSuccess = jest.fn(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const mockGetArtifactHung = jest.fn(() => {
|
||||||
|
const message = new http.IncomingMessage(new net.Socket())
|
||||||
|
message.statusCode = 200
|
||||||
|
// Don't push any data or call push(null) to end the stream
|
||||||
|
// This creates a stream that hangs and never completes
|
||||||
|
return {
|
||||||
|
message
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const mockGetArtifactFailure = jest.fn(() => {
|
const mockGetArtifactFailure = jest.fn(() => {
|
||||||
const message = new http.IncomingMessage(new net.Socket())
|
const message = new http.IncomingMessage(new net.Socket())
|
||||||
message.statusCode = 500
|
message.statusCode = 500
|
||||||
@@ -121,6 +131,16 @@ const mockGetArtifactFailure = jest.fn(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const mockGetArtifactMalicious = jest.fn(() => {
|
||||||
|
const message = new http.IncomingMessage(new net.Socket())
|
||||||
|
message.statusCode = 200
|
||||||
|
message.push(fs.readFileSync(path.join(__dirname, 'fixtures', 'evil.zip'))) // evil.zip contains files that are formatted x/../../etc/hosts
|
||||||
|
message.push(null)
|
||||||
|
return {
|
||||||
|
message
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
describe('download-artifact', () => {
|
describe('download-artifact', () => {
|
||||||
describe('public', () => {
|
describe('public', () => {
|
||||||
beforeEach(setup)
|
beforeEach(setup)
|
||||||
@@ -170,6 +190,59 @@ describe('download-artifact', () => {
|
|||||||
expect(response.downloadPath).toBe(fixtures.workspaceDir)
|
expect(response.downloadPath).toBe(fixtures.workspaceDir)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should not allow path traversal from malicious artifacts', async () => {
|
||||||
|
const downloadArtifactMock = github.getOctokit(fixtures.token).rest
|
||||||
|
.actions.downloadArtifact as MockedDownloadArtifact
|
||||||
|
downloadArtifactMock.mockResolvedValueOnce({
|
||||||
|
headers: {
|
||||||
|
location: fixtures.blobStorageUrl
|
||||||
|
},
|
||||||
|
status: 302,
|
||||||
|
url: '',
|
||||||
|
data: Buffer.from('')
|
||||||
|
})
|
||||||
|
|
||||||
|
const mockHttpClient = (HttpClient as jest.Mock).mockImplementation(
|
||||||
|
() => {
|
||||||
|
return {
|
||||||
|
get: mockGetArtifactMalicious
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const response = await downloadArtifactPublic(
|
||||||
|
fixtures.artifactID,
|
||||||
|
fixtures.repositoryOwner,
|
||||||
|
fixtures.repositoryName,
|
||||||
|
fixtures.token
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(downloadArtifactMock).toHaveBeenCalledWith({
|
||||||
|
owner: fixtures.repositoryOwner,
|
||||||
|
repo: fixtures.repositoryName,
|
||||||
|
artifact_id: fixtures.artifactID,
|
||||||
|
archive_format: 'zip',
|
||||||
|
request: {
|
||||||
|
redirect: 'manual'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString())
|
||||||
|
expect(mockGetArtifactMalicious).toHaveBeenCalledWith(
|
||||||
|
fixtures.blobStorageUrl
|
||||||
|
)
|
||||||
|
|
||||||
|
// ensure path traversal was not possible
|
||||||
|
expect(
|
||||||
|
fs.existsSync(path.join(fixtures.workspaceDir, 'x/etc/hosts'))
|
||||||
|
).toBe(true)
|
||||||
|
expect(
|
||||||
|
fs.existsSync(path.join(fixtures.workspaceDir, 'y/etc/hosts'))
|
||||||
|
).toBe(true)
|
||||||
|
|
||||||
|
expect(response.downloadPath).toBe(fixtures.workspaceDir)
|
||||||
|
})
|
||||||
|
|
||||||
it('should successfully download an artifact to user defined path', async () => {
|
it('should successfully download an artifact to user defined path', async () => {
|
||||||
const customPath = path.join(testDir, 'custom')
|
const customPath = path.join(testDir, 'custom')
|
||||||
|
|
||||||
@@ -256,14 +329,6 @@ describe('download-artifact', () => {
|
|||||||
|
|
||||||
const mockGet = jest.fn(async () => {
|
const mockGet = jest.fn(async () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// Resolve with a 200 status code immediately
|
|
||||||
resolve({
|
|
||||||
message: msg,
|
|
||||||
readBody: async () => {
|
|
||||||
return Promise.resolve(`{"ok": true}`)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Reject with an error after 31 seconds
|
// Reject with an error after 31 seconds
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
reject(new Error('Request timeout'))
|
reject(new Error('Request timeout'))
|
||||||
@@ -556,4 +621,32 @@ describe('download-artifact', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('streamExtractExternal', () => {
|
||||||
|
it('should fail if the timeout is exceeded', async () => {
|
||||||
|
const mockSlowGetArtifact = jest.fn(mockGetArtifactHung)
|
||||||
|
|
||||||
|
const mockHttpClient = (HttpClient as jest.Mock).mockImplementation(
|
||||||
|
() => {
|
||||||
|
return {
|
||||||
|
get: mockSlowGetArtifact
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
try {
|
||||||
|
await streamExtractExternal(
|
||||||
|
fixtures.blobStorageUrl,
|
||||||
|
fixtures.workspaceDir,
|
||||||
|
{timeout: 2}
|
||||||
|
)
|
||||||
|
expect(true).toBe(false) // should not be called
|
||||||
|
} catch (e) {
|
||||||
|
expect(e).toBeInstanceOf(Error)
|
||||||
|
expect(e.message).toContain('did not respond in 2ms')
|
||||||
|
expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString())
|
||||||
|
expect(mockSlowGetArtifact).toHaveBeenCalledTimes(1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Binary file not shown.
@@ -3,15 +3,15 @@ import type {RequestInterface} from '@octokit/types'
|
|||||||
import {
|
import {
|
||||||
getArtifactInternal,
|
getArtifactInternal,
|
||||||
getArtifactPublic
|
getArtifactPublic
|
||||||
} from '../src/internal/find/get-artifact'
|
} from '../src/internal/find/get-artifact.js'
|
||||||
import * as config from '../src/internal/shared/config'
|
import * as config from '../src/internal/shared/config.js'
|
||||||
import {ArtifactServiceClientJSON, Timestamp} from '../src/generated'
|
import {ArtifactServiceClientJSON, Timestamp} from '../src/generated/index.js'
|
||||||
import * as util from '../src/internal/shared/util'
|
import * as util from '../src/internal/shared/util.js'
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common.js'
|
||||||
import {
|
import {
|
||||||
ArtifactNotFoundError,
|
ArtifactNotFoundError,
|
||||||
InvalidResponseError
|
InvalidResponseError
|
||||||
} from '../src/internal/shared/errors'
|
} from '../src/internal/shared/errors.js'
|
||||||
|
|
||||||
type MockedRequest = jest.MockedFunction<RequestInterface<object>>
|
type MockedRequest = jest.MockedFunction<RequestInterface<object>>
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import type {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types'
|
|
||||||
import type {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types'
|
import type {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types'
|
||||||
import {
|
import {
|
||||||
listArtifactsInternal,
|
listArtifactsInternal,
|
||||||
listArtifactsPublic
|
listArtifactsPublic
|
||||||
} from '../src/internal/find/list-artifacts'
|
} from '../src/internal/find/list-artifacts.js'
|
||||||
import * as config from '../src/internal/shared/config'
|
import * as config from '../src/internal/shared/config.js'
|
||||||
import {ArtifactServiceClientJSON, Timestamp} from '../src/generated'
|
import {ArtifactServiceClientJSON, Timestamp} from '../src/generated/index.js'
|
||||||
import * as util from '../src/internal/shared/util'
|
import * as util from '../src/internal/shared/util.js'
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common.js'
|
||||||
import {Artifact} from '../src/internal/shared/interfaces'
|
import {Artifact} from '../src/internal/shared/interfaces.js'
|
||||||
|
import {RequestInterface} from '@octokit/types'
|
||||||
|
|
||||||
type MockedListWorkflowRunArtifacts = jest.MockedFunction<
|
type MockedRequest = jest.MockedFunction<RequestInterface<object>>
|
||||||
RestEndpointMethods['actions']['listWorkflowRunArtifacts']
|
|
||||||
>
|
|
||||||
|
|
||||||
jest.mock('@actions/github', () => ({
|
jest.mock('@actions/github', () => ({
|
||||||
getOctokit: jest.fn().mockReturnValue({
|
getOctokit: jest.fn().mockReturnValue({
|
||||||
|
request: jest.fn(),
|
||||||
rest: {
|
rest: {
|
||||||
actions: {
|
actions: {
|
||||||
listWorkflowRunArtifacts: jest.fn()
|
listWorkflowRunArtifacts: jest.fn()
|
||||||
@@ -81,10 +80,10 @@ describe('list-artifact', () => {
|
|||||||
|
|
||||||
describe('public', () => {
|
describe('public', () => {
|
||||||
it('should return a list of artifacts', async () => {
|
it('should return a list of artifacts', async () => {
|
||||||
const mockListArtifacts = github.getOctokit(fixtures.token).rest.actions
|
const mockRequest = github.getOctokit(fixtures.token)
|
||||||
.listWorkflowRunArtifacts as MockedListWorkflowRunArtifacts
|
.request as MockedRequest
|
||||||
|
|
||||||
mockListArtifacts.mockResolvedValueOnce({
|
mockRequest.mockResolvedValueOnce({
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
url: '',
|
url: '',
|
||||||
@@ -105,10 +104,10 @@ describe('list-artifact', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should return the latest artifact when latest is specified', async () => {
|
it('should return the latest artifact when latest is specified', async () => {
|
||||||
const mockListArtifacts = github.getOctokit(fixtures.token).rest.actions
|
const mockRequest = github.getOctokit(fixtures.token)
|
||||||
.listWorkflowRunArtifacts as MockedListWorkflowRunArtifacts
|
.request as MockedRequest
|
||||||
|
|
||||||
mockListArtifacts.mockResolvedValueOnce({
|
mockRequest.mockResolvedValueOnce({
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
url: '',
|
url: '',
|
||||||
@@ -129,10 +128,10 @@ describe('list-artifact', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('can return empty artifacts', async () => {
|
it('can return empty artifacts', async () => {
|
||||||
const mockListArtifacts = github.getOctokit(fixtures.token).rest.actions
|
const mockRequest = github.getOctokit(fixtures.token)
|
||||||
.listWorkflowRunArtifacts as MockedListWorkflowRunArtifacts
|
.request as MockedRequest
|
||||||
|
|
||||||
mockListArtifacts.mockResolvedValueOnce({
|
mockRequest.mockResolvedValueOnce({
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
url: '',
|
url: '',
|
||||||
@@ -156,10 +155,10 @@ describe('list-artifact', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should fail if non-200 response', async () => {
|
it('should fail if non-200 response', async () => {
|
||||||
const mockListArtifacts = github.getOctokit(fixtures.token).rest.actions
|
const mockRequest = github.getOctokit(fixtures.token)
|
||||||
.listWorkflowRunArtifacts as MockedListWorkflowRunArtifacts
|
.request as MockedRequest
|
||||||
|
|
||||||
mockListArtifacts.mockRejectedValue(new Error('boom'))
|
mockRequest.mockRejectedValueOnce(new Error('boom'))
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
listArtifactsPublic(
|
listArtifactsPublic(
|
||||||
@@ -171,6 +170,126 @@ describe('list-artifact', () => {
|
|||||||
)
|
)
|
||||||
).rejects.toThrow('boom')
|
).rejects.toThrow('boom')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should handle pagination correctly when fetching multiple pages', async () => {
|
||||||
|
const mockRequest = github.getOctokit(fixtures.token)
|
||||||
|
.request as MockedRequest
|
||||||
|
|
||||||
|
const manyArtifacts = Array.from({length: 150}, (_, i) => ({
|
||||||
|
id: i + 1,
|
||||||
|
name: `artifact-${i + 1}`,
|
||||||
|
size: 100,
|
||||||
|
createdAt: new Date('2023-12-01')
|
||||||
|
}))
|
||||||
|
|
||||||
|
mockRequest
|
||||||
|
.mockResolvedValueOnce({
|
||||||
|
status: 200,
|
||||||
|
headers: {},
|
||||||
|
url: '',
|
||||||
|
data: {
|
||||||
|
...artifactsToListResponse(manyArtifacts.slice(0, 100)),
|
||||||
|
total_count: 150
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.mockResolvedValueOnce({
|
||||||
|
status: 200,
|
||||||
|
headers: {},
|
||||||
|
url: '',
|
||||||
|
data: {
|
||||||
|
...artifactsToListResponse(manyArtifacts.slice(100, 150)),
|
||||||
|
total_count: 150
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const response = await listArtifactsPublic(
|
||||||
|
fixtures.runId,
|
||||||
|
fixtures.owner,
|
||||||
|
fixtures.repo,
|
||||||
|
fixtures.token,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
|
// Verify that both API calls were made
|
||||||
|
expect(mockRequest).toHaveBeenCalledTimes(2)
|
||||||
|
|
||||||
|
// Should return all 150 artifacts across both pages
|
||||||
|
expect(response.artifacts).toHaveLength(150)
|
||||||
|
|
||||||
|
// Verify we got artifacts from both pages
|
||||||
|
expect(response.artifacts[0].name).toBe('artifact-1')
|
||||||
|
expect(response.artifacts[99].name).toBe('artifact-100')
|
||||||
|
expect(response.artifacts[100].name).toBe('artifact-101')
|
||||||
|
expect(response.artifacts[149].name).toBe('artifact-150')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should respect ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT environment variable', async () => {
|
||||||
|
const originalEnv = process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT
|
||||||
|
process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT = '150'
|
||||||
|
|
||||||
|
jest.resetModules()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const {listArtifactsPublic: listArtifactsPublicReloaded} = await import(
|
||||||
|
'../src/internal/find/list-artifacts'
|
||||||
|
)
|
||||||
|
const githubReloaded = await import('@actions/github')
|
||||||
|
|
||||||
|
const mockRequest = (githubReloaded.getOctokit as jest.Mock)(
|
||||||
|
fixtures.token
|
||||||
|
).request as MockedRequest
|
||||||
|
|
||||||
|
const manyArtifacts = Array.from({length: 200}, (_, i) => ({
|
||||||
|
id: i + 1,
|
||||||
|
name: `artifact-${i + 1}`,
|
||||||
|
size: 100,
|
||||||
|
createdAt: new Date('2023-12-01')
|
||||||
|
}))
|
||||||
|
|
||||||
|
mockRequest
|
||||||
|
.mockResolvedValueOnce({
|
||||||
|
status: 200,
|
||||||
|
headers: {},
|
||||||
|
url: '',
|
||||||
|
data: {
|
||||||
|
...artifactsToListResponse(manyArtifacts.slice(0, 100)),
|
||||||
|
total_count: 200
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.mockResolvedValueOnce({
|
||||||
|
status: 200,
|
||||||
|
headers: {},
|
||||||
|
url: '',
|
||||||
|
data: {
|
||||||
|
...artifactsToListResponse(manyArtifacts.slice(100, 150)),
|
||||||
|
total_count: 200
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const response = await listArtifactsPublicReloaded(
|
||||||
|
fixtures.runId,
|
||||||
|
fixtures.owner,
|
||||||
|
fixtures.repo,
|
||||||
|
fixtures.token,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
|
// Should only return 150 artifacts due to the limit
|
||||||
|
expect(response.artifacts).toHaveLength(150)
|
||||||
|
expect(response.artifacts[0].name).toBe('artifact-1')
|
||||||
|
expect(response.artifacts[149].name).toBe('artifact-150')
|
||||||
|
} finally {
|
||||||
|
// Restore original environment variable
|
||||||
|
if (originalEnv !== undefined) {
|
||||||
|
process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT = originalEnv
|
||||||
|
} else {
|
||||||
|
delete process.env.ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset modules again to restore original state
|
||||||
|
jest.resetModules()
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('internal', () => {
|
describe('internal', () => {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
validateArtifactName,
|
validateArtifactName,
|
||||||
validateFilePath
|
validateFilePath
|
||||||
} from '../src/internal/upload/path-and-artifact-name-validation'
|
} from '../src/internal/upload/path-and-artifact-name-validation.js'
|
||||||
|
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common.js'
|
||||||
|
|
||||||
describe('Path and artifact name validation', () => {
|
describe('Path and artifact name validation', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Timestamp} from '../src/generated'
|
import {Timestamp} from '../src/generated/index.js'
|
||||||
import * as retention from '../src/internal/upload/retention'
|
import * as retention from '../src/internal/upload/retention.js'
|
||||||
|
|
||||||
describe('retention', () => {
|
describe('retention', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -1,257 +1,173 @@
|
|||||||
import * as uploadZipSpecification from '../src/internal/upload/upload-zip-specification'
|
import * as uploadZipSpecification from '../src/internal/upload/upload-zip-specification.js'
|
||||||
import * as zip from '../src/internal/upload/zip'
|
import * as zip from '../src/internal/upload/zip.js'
|
||||||
import * as util from '../src/internal/shared/util'
|
import * as util from '../src/internal/shared/util.js'
|
||||||
import * as retention from '../src/internal/upload/retention'
|
import * as config from '../src/internal/shared/config.js'
|
||||||
import * as config from '../src/internal/shared/config'
|
import {ArtifactServiceClientJSON} from '../src/generated/index.js'
|
||||||
import {Timestamp, ArtifactServiceClientJSON} from '../src/generated'
|
import * as blobUpload from '../src/internal/upload/blob-upload.js'
|
||||||
import * as blobUpload from '../src/internal/upload/blob-upload'
|
import {uploadArtifact} from '../src/internal/upload/upload-artifact.js'
|
||||||
import {uploadArtifact} from '../src/internal/upload/upload-artifact'
|
import {noopLogs} from './common.js'
|
||||||
import {noopLogs} from './common'
|
import {FilesNotFoundError} from '../src/internal/shared/errors.js'
|
||||||
import {FilesNotFoundError} from '../src/internal/shared/errors'
|
import {BlockBlobUploadStreamOptions} from '@azure/storage-blob'
|
||||||
|
import * as fs from 'fs'
|
||||||
|
import * as path from 'path'
|
||||||
|
import unzip from 'unzip-stream'
|
||||||
|
|
||||||
|
const uploadStreamMock = jest.fn()
|
||||||
|
const blockBlobClientMock = jest.fn().mockImplementation(() => ({
|
||||||
|
uploadStream: uploadStreamMock
|
||||||
|
}))
|
||||||
|
|
||||||
|
jest.mock('@azure/storage-blob', () => ({
|
||||||
|
BlobClient: jest.fn().mockImplementation(() => {
|
||||||
|
return {
|
||||||
|
getBlockBlobClient: blockBlobClientMock
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}))
|
||||||
|
|
||||||
|
const fixtures = {
|
||||||
|
uploadDirectory: path.join(__dirname, '_temp', 'plz-upload'),
|
||||||
|
files: [
|
||||||
|
{name: 'file1.txt', content: 'test 1 file content'},
|
||||||
|
{name: 'file2.txt', content: 'test 2 file content'},
|
||||||
|
{name: 'file3.txt', content: 'test 3 file content'},
|
||||||
|
{
|
||||||
|
name: 'real.txt',
|
||||||
|
content: 'from a symlink'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'relative.txt',
|
||||||
|
content: 'from a symlink',
|
||||||
|
symlink: 'real.txt',
|
||||||
|
relative: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'absolute.txt',
|
||||||
|
content: 'from a symlink',
|
||||||
|
symlink: 'real.txt',
|
||||||
|
relative: false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
backendIDs: {
|
||||||
|
workflowRunBackendId: '67dbcc20-e851-4452-a7c3-2cc0d2e0ec67',
|
||||||
|
workflowJobRunBackendId: '5f49179d-3386-4c38-85f7-00f8138facd0'
|
||||||
|
},
|
||||||
|
runtimeToken: 'test-token',
|
||||||
|
resultsServiceURL: 'http://results.local',
|
||||||
|
inputs: {
|
||||||
|
artifactName: 'test-artifact',
|
||||||
|
files: [
|
||||||
|
'/home/user/files/plz-upload/file1.txt',
|
||||||
|
'/home/user/files/plz-upload/file2.txt',
|
||||||
|
'/home/user/files/plz-upload/dir/file3.txt'
|
||||||
|
],
|
||||||
|
rootDirectory: '/home/user/files/plz-upload'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
describe('upload-artifact', () => {
|
describe('upload-artifact', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
fs.mkdirSync(fixtures.uploadDirectory, {
|
||||||
|
recursive: true
|
||||||
|
})
|
||||||
|
|
||||||
|
for (const file of fixtures.files) {
|
||||||
|
if (file.symlink) {
|
||||||
|
let symlinkPath = file.symlink
|
||||||
|
if (!file.relative) {
|
||||||
|
symlinkPath = path.join(fixtures.uploadDirectory, file.symlink)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(path.join(fixtures.uploadDirectory, file.name))) {
|
||||||
|
fs.symlinkSync(
|
||||||
|
symlinkPath,
|
||||||
|
path.join(fixtures.uploadDirectory, file.name),
|
||||||
|
'file'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fs.writeFileSync(
|
||||||
|
path.join(fixtures.uploadDirectory, file.name),
|
||||||
|
file.content
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
noopLogs()
|
noopLogs()
|
||||||
|
jest
|
||||||
|
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
||||||
|
.mockReturnValue()
|
||||||
|
jest
|
||||||
|
.spyOn(util, 'getBackendIdsFromToken')
|
||||||
|
.mockReturnValue(fixtures.backendIDs)
|
||||||
|
jest
|
||||||
|
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
||||||
|
.mockReturnValue(
|
||||||
|
fixtures.files.map(file => ({
|
||||||
|
sourcePath: path.join(fixtures.uploadDirectory, file.name),
|
||||||
|
destinationPath: file.name,
|
||||||
|
stats: fs.statSync(path.join(fixtures.uploadDirectory, file.name))
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
jest.spyOn(config, 'getRuntimeToken').mockReturnValue(fixtures.runtimeToken)
|
||||||
|
jest
|
||||||
|
.spyOn(config, 'getResultsServiceUrl')
|
||||||
|
.mockReturnValue(fixtures.resultsServiceURL)
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
jest.restoreAllMocks()
|
jest.restoreAllMocks()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should successfully upload an artifact', () => {
|
it('should reject if there are no files to upload', async () => {
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
|
||||||
.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
ok: true,
|
|
||||||
signedUploadUrl: 'https://signed-upload-url.com'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest.spyOn(blobUpload, 'uploadZipToBlobStorage').mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
uploadSize: 1234,
|
|
||||||
sha256Hash: 'test-sha256-hash'
|
|
||||||
})
|
|
||||||
)
|
|
||||||
jest
|
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
|
||||||
.mockReturnValue(Promise.resolve({ok: true, artifactId: '1'}))
|
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).resolves.toEqual({size: 1234, id: 1})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should throw an error if the root directory is invalid', () => {
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockImplementation(() => {
|
|
||||||
throw new Error('Invalid root directory')
|
|
||||||
})
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
|
||||||
'test-artifact',
|
|
||||||
[
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow('Invalid root directory')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should reject if there are no files to upload', () => {
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
jest
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
||||||
|
.mockClear()
|
||||||
.mockReturnValue([])
|
.mockReturnValue([])
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
expect(uploadResp).rejects.toThrowError(FilesNotFoundError)
|
await expect(uploadResp).rejects.toThrowError(FilesNotFoundError)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should reject if no backend IDs are found', () => {
|
it('should reject if no backend IDs are found', async () => {
|
||||||
jest
|
jest.spyOn(util, 'getBackendIdsFromToken').mockRestore()
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow()
|
await expect(uploadResp).rejects.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return false if the creation request fails', () => {
|
it('should return false if the creation request fails', async () => {
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
.spyOn(zip, 'createZipUploadStream')
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
jest
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
.mockReturnValue(Promise.resolve({ok: false, signedUploadUrl: ''}))
|
.mockReturnValue(Promise.resolve({ok: false, signedUploadUrl: ''}))
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow()
|
await expect(uploadResp).rejects.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return false if blob storage upload is unsuccessful', () => {
|
it('should return false if blob storage upload is unsuccessful', async () => {
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
.spyOn(zip, 'createZipUploadStream')
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
jest
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
.mockReturnValue(
|
.mockReturnValue(
|
||||||
@@ -264,57 +180,19 @@ describe('upload-artifact', () => {
|
|||||||
.spyOn(blobUpload, 'uploadZipToBlobStorage')
|
.spyOn(blobUpload, 'uploadZipToBlobStorage')
|
||||||
.mockReturnValue(Promise.reject(new Error('boom')))
|
.mockReturnValue(Promise.reject(new Error('boom')))
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow()
|
await expect(uploadResp).rejects.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should reject if finalize artifact fails', () => {
|
it('should reject if finalize artifact fails', async () => {
|
||||||
const mockDate = new Date('2020-01-01')
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'validateRootDirectory')
|
|
||||||
.mockReturnValue()
|
|
||||||
jest
|
|
||||||
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
|
||||||
.mockReturnValue([
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file1.txt',
|
|
||||||
destinationPath: 'file1.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/file2.txt',
|
|
||||||
destinationPath: 'file2.txt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourcePath: '/home/user/files/plz-upload/dir/file3.txt',
|
|
||||||
destinationPath: 'dir/file3.txt'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(zip, 'createZipUploadStream')
|
.spyOn(zip, 'createZipUploadStream')
|
||||||
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
.mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1)))
|
||||||
jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({
|
|
||||||
workflowRunBackendId: '1234',
|
|
||||||
workflowJobRunBackendId: '5678'
|
|
||||||
})
|
|
||||||
jest
|
|
||||||
.spyOn(retention, 'getExpiration')
|
|
||||||
.mockReturnValue(Timestamp.fromDate(mockDate))
|
|
||||||
jest
|
jest
|
||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
.mockReturnValue(
|
.mockReturnValue(
|
||||||
@@ -333,22 +211,163 @@ describe('upload-artifact', () => {
|
|||||||
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
||||||
.mockReturnValue(Promise.resolve({ok: false, artifactId: ''}))
|
.mockReturnValue(Promise.resolve({ok: false, artifactId: ''}))
|
||||||
|
|
||||||
// ArtifactHttpClient mocks
|
|
||||||
jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token')
|
|
||||||
jest
|
|
||||||
.spyOn(config, 'getResultsServiceUrl')
|
|
||||||
.mockReturnValue('https://test-url.com')
|
|
||||||
|
|
||||||
const uploadResp = uploadArtifact(
|
const uploadResp = uploadArtifact(
|
||||||
'test-artifact',
|
fixtures.inputs.artifactName,
|
||||||
[
|
fixtures.inputs.files,
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
fixtures.inputs.rootDirectory
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
],
|
|
||||||
'/home/user/files/plz-upload'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(uploadResp).rejects.toThrow()
|
await expect(uploadResp).rejects.toThrow()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should successfully upload an artifact', async () => {
|
||||||
|
jest
|
||||||
|
.spyOn(uploadZipSpecification, 'getUploadZipSpecification')
|
||||||
|
.mockRestore()
|
||||||
|
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
|
.mockReturnValue(
|
||||||
|
Promise.resolve({
|
||||||
|
ok: true,
|
||||||
|
signedUploadUrl: 'https://signed-upload-url.local'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
||||||
|
.mockReturnValue(
|
||||||
|
Promise.resolve({
|
||||||
|
ok: true,
|
||||||
|
artifactId: '1'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
let loadedBytes = 0
|
||||||
|
const uploadedZip = path.join(
|
||||||
|
fixtures.uploadDirectory,
|
||||||
|
'..',
|
||||||
|
'uploaded.zip'
|
||||||
|
)
|
||||||
|
uploadStreamMock.mockImplementation(
|
||||||
|
async (
|
||||||
|
stream: NodeJS.ReadableStream,
|
||||||
|
bufferSize?: number,
|
||||||
|
maxConcurrency?: number,
|
||||||
|
options?: BlockBlobUploadStreamOptions
|
||||||
|
) => {
|
||||||
|
const {onProgress} = options || {}
|
||||||
|
|
||||||
|
if (fs.existsSync(uploadedZip)) {
|
||||||
|
fs.unlinkSync(uploadedZip)
|
||||||
|
}
|
||||||
|
const uploadedZipStream = fs.createWriteStream(uploadedZip)
|
||||||
|
|
||||||
|
onProgress?.({loadedBytes: 0})
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
stream.on('data', chunk => {
|
||||||
|
loadedBytes += chunk.length
|
||||||
|
uploadedZipStream.write(chunk)
|
||||||
|
onProgress?.({loadedBytes})
|
||||||
|
})
|
||||||
|
stream.on('end', () => {
|
||||||
|
onProgress?.({loadedBytes})
|
||||||
|
uploadedZipStream.end()
|
||||||
|
resolve({})
|
||||||
|
})
|
||||||
|
stream.on('error', err => {
|
||||||
|
reject(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const {id, size, digest} = await uploadArtifact(
|
||||||
|
fixtures.inputs.artifactName,
|
||||||
|
fixtures.files.map(file =>
|
||||||
|
path.join(fixtures.uploadDirectory, file.name)
|
||||||
|
),
|
||||||
|
fixtures.uploadDirectory
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(id).toBe(1)
|
||||||
|
expect(size).toBe(loadedBytes)
|
||||||
|
expect(digest).toBeDefined()
|
||||||
|
expect(digest).toHaveLength(64)
|
||||||
|
|
||||||
|
const extractedDirectory = path.join(
|
||||||
|
fixtures.uploadDirectory,
|
||||||
|
'..',
|
||||||
|
'extracted'
|
||||||
|
)
|
||||||
|
if (fs.existsSync(extractedDirectory)) {
|
||||||
|
fs.rmdirSync(extractedDirectory, {recursive: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
const extract = new Promise((resolve, reject) => {
|
||||||
|
fs.createReadStream(uploadedZip)
|
||||||
|
.pipe(unzip.Extract({path: extractedDirectory}))
|
||||||
|
.on('close', () => {
|
||||||
|
resolve(true)
|
||||||
|
})
|
||||||
|
.on('error', err => {
|
||||||
|
reject(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
await expect(extract).resolves.toBe(true)
|
||||||
|
for (const file of fixtures.files) {
|
||||||
|
const filePath = path.join(extractedDirectory, file.name)
|
||||||
|
expect(fs.existsSync(filePath)).toBe(true)
|
||||||
|
expect(fs.readFileSync(filePath, 'utf8')).toBe(file.content)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw an error uploading blob chunks get delayed', async () => {
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact')
|
||||||
|
.mockReturnValue(
|
||||||
|
Promise.resolve({
|
||||||
|
ok: true,
|
||||||
|
signedUploadUrl: 'https://signed-upload-url.local'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
jest
|
||||||
|
.spyOn(ArtifactServiceClientJSON.prototype, 'FinalizeArtifact')
|
||||||
|
.mockReturnValue(
|
||||||
|
Promise.resolve({
|
||||||
|
ok: true,
|
||||||
|
artifactId: '1'
|
||||||
|
})
|
||||||
|
)
|
||||||
|
jest
|
||||||
|
.spyOn(config, 'getResultsServiceUrl')
|
||||||
|
.mockReturnValue('https://results.local')
|
||||||
|
|
||||||
|
jest.spyOn(config, 'getUploadChunkTimeout').mockReturnValue(2_000)
|
||||||
|
|
||||||
|
uploadStreamMock.mockImplementation(
|
||||||
|
async (
|
||||||
|
stream: NodeJS.ReadableStream,
|
||||||
|
bufferSize?: number,
|
||||||
|
maxConcurrency?: number,
|
||||||
|
options?: BlockBlobUploadStreamOptions
|
||||||
|
) => {
|
||||||
|
const {onProgress, abortSignal} = options || {}
|
||||||
|
onProgress?.({loadedBytes: 0})
|
||||||
|
return new Promise(resolve => {
|
||||||
|
abortSignal?.addEventListener('abort', () => {
|
||||||
|
resolve({})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const uploadResp = uploadArtifact(
|
||||||
|
fixtures.inputs.artifactName,
|
||||||
|
fixtures.inputs.files,
|
||||||
|
fixtures.inputs.rootDirectory
|
||||||
|
)
|
||||||
|
|
||||||
|
await expect(uploadResp).rejects.toThrow('Upload progress stalled.')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import {promises as fs} from 'fs'
|
|||||||
import {
|
import {
|
||||||
getUploadZipSpecification,
|
getUploadZipSpecification,
|
||||||
validateRootDirectory
|
validateRootDirectory
|
||||||
} from '../src/internal/upload/upload-zip-specification'
|
} from '../src/internal/upload/upload-zip-specification.js'
|
||||||
import {noopLogs} from './common'
|
import {noopLogs} from './common.js'
|
||||||
|
|
||||||
const root = path.join(__dirname, '_temp', 'upload-specification')
|
const root = path.join(__dirname, '_temp', 'upload-specification')
|
||||||
const goodItem1Path = path.join(
|
const goodItem1Path = path.join(
|
||||||
@@ -305,4 +305,22 @@ describe('Search', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('Upload Specification - Includes symlinks', async () => {
|
||||||
|
const targetPath = path.join(root, 'link-dir', 'symlink-me.txt')
|
||||||
|
await fs.mkdir(path.dirname(targetPath), {recursive: true})
|
||||||
|
await fs.writeFile(targetPath, 'symlink file content')
|
||||||
|
|
||||||
|
const uploadPath = path.join(root, 'upload-dir', 'symlink.txt')
|
||||||
|
await fs.mkdir(path.dirname(uploadPath), {recursive: true})
|
||||||
|
await fs.symlink(targetPath, uploadPath, 'file')
|
||||||
|
|
||||||
|
const specifications = getUploadZipSpecification([uploadPath], root)
|
||||||
|
expect(specifications.length).toEqual(1)
|
||||||
|
expect(specifications[0].sourcePath).toEqual(uploadPath)
|
||||||
|
expect(specifications[0].destinationPath).toEqual(
|
||||||
|
path.join('/upload-dir', 'symlink.txt')
|
||||||
|
)
|
||||||
|
expect(specifications[0].stats.isSymbolicLink()).toBe(true)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import * as config from '../src/internal/shared/config'
|
import * as config from '../src/internal/shared/config.js'
|
||||||
import * as util from '../src/internal/shared/util'
|
import * as util from '../src/internal/shared/util.js'
|
||||||
|
import {maskSigUrl, maskSecretUrls} from '../src/internal/shared/util.js'
|
||||||
|
import {setSecret, debug} from '@actions/core'
|
||||||
|
|
||||||
export const testRuntimeToken =
|
export const testRuntimeToken =
|
||||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwic2NwIjoiQWN0aW9ucy5FeGFtcGxlIEFjdGlvbnMuQW5vdGhlckV4YW1wbGU6dGVzdCBBY3Rpb25zLlJlc3VsdHM6Y2U3ZjU0YzctNjFjNy00YWFlLTg4N2YtMzBkYTQ3NWY1ZjFhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCIsImlhdCI6MTUxNjIzOTAyMn0.XYnI_wHPBlUi1mqYveJnnkJhp4dlFjqxzRmISPsqfw8'
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwic2NwIjoiQWN0aW9ucy5FeGFtcGxlIEFjdGlvbnMuQW5vdGhlckV4YW1wbGU6dGVzdCBBY3Rpb25zLlJlc3VsdHM6Y2U3ZjU0YzctNjFjNy00YWFlLTg4N2YtMzBkYTQ3NWY1ZjFhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCIsImlhdCI6MTUxNjIzOTAyMn0.XYnI_wHPBlUi1mqYveJnnkJhp4dlFjqxzRmISPsqfw8'
|
||||||
@@ -59,3 +61,159 @@ describe('get-backend-ids-from-token', () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
jest.mock('@actions/core')
|
||||||
|
|
||||||
|
describe('maskSigUrl', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('does nothing if no sig parameter is present', () => {
|
||||||
|
const url = 'https://example.com'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('masks the sig parameter in the middle of the URL and sets it as a secret', () => {
|
||||||
|
const url = 'https://example.com/?param1=value1&sig=12345¶m2=value2'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('12345')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith(encodeURIComponent('12345'))
|
||||||
|
})
|
||||||
|
|
||||||
|
it('does nothing if the URL is empty', () => {
|
||||||
|
const url = ''
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles URLs with fragments', () => {
|
||||||
|
const url = 'https://example.com?sig=12345#fragment'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('12345')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith(encodeURIComponent('12345'))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('maskSigUrl handles special characters in signatures', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles signatures with slashes', () => {
|
||||||
|
const url = 'https://example.com/?sig=abc/123'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('abc/123')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('abc%2F123')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles signatures with plus signs', () => {
|
||||||
|
const url = 'https://example.com/?sig=abc+123'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('abc 123')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('abc%20123')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles signatures with equals signs', () => {
|
||||||
|
const url = 'https://example.com/?sig=abc=123'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('abc=123')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('abc%3D123')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles already percent-encoded signatures', () => {
|
||||||
|
const url = 'https://example.com/?sig=abc%2F123%3D'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('abc/123=')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('abc%2F123%3D')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles complex Azure SAS signatures', () => {
|
||||||
|
const url =
|
||||||
|
'https://example.com/container/file.txt?sig=nXyQIUj%2F%2F06Cxt80pBRYiiJlYqtPYg5sz%2FvEh5iHAhw%3D&se=2023-12-31'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith(
|
||||||
|
'nXyQIUj//06Cxt80pBRYiiJlYqtPYg5sz/vEh5iHAhw='
|
||||||
|
)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith(
|
||||||
|
'nXyQIUj%2F%2F06Cxt80pBRYiiJlYqtPYg5sz%2FvEh5iHAhw%3D'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles signatures with multiple special characters', () => {
|
||||||
|
const url = 'https://example.com/?sig=a/b+c=d&e=f'
|
||||||
|
maskSigUrl(url)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('a/b c=d')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('a%2Fb%20c%3Dd')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('maskSecretUrls', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('masks sig parameters in signed_upload_url and signed_url', () => {
|
||||||
|
const body = {
|
||||||
|
signed_upload_url: 'https://upload.com?sig=upload123',
|
||||||
|
signed_url: 'https://download.com?sig=download123'
|
||||||
|
}
|
||||||
|
maskSecretUrls(body)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('upload123')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith(encodeURIComponent('upload123'))
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('download123')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith(encodeURIComponent('download123'))
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles case where only upload_url is present', () => {
|
||||||
|
const body = {
|
||||||
|
signed_upload_url: 'https://upload.com?sig=upload123'
|
||||||
|
}
|
||||||
|
maskSecretUrls(body)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('upload123')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith(encodeURIComponent('upload123'))
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles case where only download_url is present', () => {
|
||||||
|
const body = {
|
||||||
|
signed_url: 'https://download.com?sig=download123'
|
||||||
|
}
|
||||||
|
maskSecretUrls(body)
|
||||||
|
expect(setSecret).toHaveBeenCalledWith('download123')
|
||||||
|
expect(setSecret).toHaveBeenCalledWith(encodeURIComponent('download123'))
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles case where URLs do not contain sig parameters', () => {
|
||||||
|
const body = {
|
||||||
|
signed_upload_url: 'https://upload.com?token=abc',
|
||||||
|
signed_url: 'https://download.com?token=xyz'
|
||||||
|
}
|
||||||
|
maskSecretUrls(body)
|
||||||
|
expect(setSecret).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles empty string URLs', () => {
|
||||||
|
const body = {
|
||||||
|
signed_upload_url: '',
|
||||||
|
signed_url: ''
|
||||||
|
}
|
||||||
|
maskSecretUrls(body)
|
||||||
|
expect(setSecret).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('does nothing if body is not an object or is null', () => {
|
||||||
|
maskSecretUrls(null)
|
||||||
|
expect(debug).toHaveBeenCalledWith('body is not an object or is null')
|
||||||
|
expect(setSecret).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('does nothing if signed_upload_url and signed_url are not strings', () => {
|
||||||
|
const body = {
|
||||||
|
signed_upload_url: 123,
|
||||||
|
signed_url: 456
|
||||||
|
}
|
||||||
|
maskSecretUrls(body)
|
||||||
|
expect(setSecret).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
- [Frequently Asked Questions](#frequently-asked-questions)
|
- [Frequently Asked Questions](#frequently-asked-questions)
|
||||||
- [Supported Characters](#supported-characters)
|
- [Supported Characters](#supported-characters)
|
||||||
- [Compression? ZIP? How is my artifact stored?](#compression-zip-how-is-my-artifact-stored)
|
- [Compression? ZIP? How is my artifact stored?](#compression-zip-how-is-my-artifact-stored)
|
||||||
|
- [Which versions of the artifacts packages are compatible?](#which-versions-of-the-artifacts-packages-are-compatible)
|
||||||
|
- [How long will my artifact be available?](#how-long-will-my-artifact-be-available)
|
||||||
|
|
||||||
## Supported Characters
|
## Supported Characters
|
||||||
|
|
||||||
@@ -35,22 +37,26 @@ Higher levels will result in better compression, but will take longer to complet
|
|||||||
For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads.
|
For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads.
|
||||||
|
|
||||||
## Which versions of the artifacts packages are compatible?
|
## Which versions of the artifacts packages are compatible?
|
||||||
[actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact), are part of the [GitHub Actions toolkit](https://github.com/actions/toolkit) and are typically used together to upload and download artifacts in your workflows.
|
[actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact), leverage [GitHub Actions toolkit](https://github.com/actions/toolkit) and are typically used together to upload and download artifacts in your workflows.
|
||||||
|
|
||||||
1. **Matching Versions:**
|
| upload-artifact | download-artifact | toolkit |
|
||||||
- Use matching versions of `actions/upload-artifact` and `actions/download-artifact` to ensure compatibility.
|
|---|---|---|
|
||||||
|
| v4 | v4 | v2 |
|
||||||
|
| < v3 | < v3 | < v1 |
|
||||||
|
|
||||||
2. **Workflow YAML File:**
|
Use matching versions of `actions/upload-artifact` and `actions/download-artifact` to ensure compatibility.
|
||||||
- In your GitHub Actions workflow YAML file, you specify the version of the actions you want to use. For example:
|
|
||||||
```yaml
|
In your GitHub Actions workflow YAML file, you specify the version of the actions you want to use. For example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
# ...
|
# ...
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Release Notes:**
|
**Release Notes:**
|
||||||
- Check the release notes for each repository to see if there are any specific notes about compatibility or changes in behavior.
|
Check the release notes for each repository to see if there are any specific notes about compatibility or changes in behavior.
|
||||||
|
|
||||||
## How long will my artifact be available?
|
## How long will my artifact be available?
|
||||||
The default retention period is 90 days. For more information, visit: https://github.com/actions/upload-artifact?tab=readme-ov-file#retention-period
|
The default retention period is **90 days**. For more information, visit: https://github.com/actions/upload-artifact?tab=readme-ov-file#retention-period
|
||||||
|
|||||||
@@ -11,11 +11,14 @@
|
|||||||
- [FilesNotFoundError](classes/FilesNotFoundError.md)
|
- [FilesNotFoundError](classes/FilesNotFoundError.md)
|
||||||
- [GHESNotSupportedError](classes/GHESNotSupportedError.md)
|
- [GHESNotSupportedError](classes/GHESNotSupportedError.md)
|
||||||
- [InvalidResponseError](classes/InvalidResponseError.md)
|
- [InvalidResponseError](classes/InvalidResponseError.md)
|
||||||
|
- [NetworkError](classes/NetworkError.md)
|
||||||
|
- [UsageError](classes/UsageError.md)
|
||||||
|
|
||||||
### Interfaces
|
### Interfaces
|
||||||
|
|
||||||
- [Artifact](interfaces/Artifact.md)
|
- [Artifact](interfaces/Artifact.md)
|
||||||
- [ArtifactClient](interfaces/ArtifactClient.md)
|
- [ArtifactClient](interfaces/ArtifactClient.md)
|
||||||
|
- [DeleteArtifactResponse](interfaces/DeleteArtifactResponse.md)
|
||||||
- [DownloadArtifactOptions](interfaces/DownloadArtifactOptions.md)
|
- [DownloadArtifactOptions](interfaces/DownloadArtifactOptions.md)
|
||||||
- [DownloadArtifactResponse](interfaces/DownloadArtifactResponse.md)
|
- [DownloadArtifactResponse](interfaces/DownloadArtifactResponse.md)
|
||||||
- [FindOptions](interfaces/FindOptions.md)
|
- [FindOptions](interfaces/FindOptions.md)
|
||||||
@@ -37,4 +40,4 @@
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/artifact.ts:7](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/artifact.ts#L7)
|
[src/artifact.ts:7](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/artifact.ts#L7)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ Error.constructor
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/errors.ts:24](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L24)
|
[src/internal/shared/errors.ts:24](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L24)
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ The default artifact client that is used by the artifact action(s).
|
|||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
|
|
||||||
|
- [deleteArtifact](DefaultArtifactClient.md#deleteartifact)
|
||||||
- [downloadArtifact](DefaultArtifactClient.md#downloadartifact)
|
- [downloadArtifact](DefaultArtifactClient.md#downloadartifact)
|
||||||
- [getArtifact](DefaultArtifactClient.md#getartifact)
|
- [getArtifact](DefaultArtifactClient.md#getartifact)
|
||||||
- [listArtifacts](DefaultArtifactClient.md#listartifacts)
|
- [listArtifacts](DefaultArtifactClient.md#listartifacts)
|
||||||
@@ -33,6 +34,37 @@ The default artifact client that is used by the artifact action(s).
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
### deleteArtifact
|
||||||
|
|
||||||
|
▸ **deleteArtifact**(`artifactName`, `options?`): `Promise`\<[`DeleteArtifactResponse`](../interfaces/DeleteArtifactResponse.md)\>
|
||||||
|
|
||||||
|
Delete an Artifact
|
||||||
|
|
||||||
|
If `options.findBy` is specified, this will use the public Delete Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `artifactName` | `string` | The name of the artifact to delete |
|
||||||
|
| `options?` | [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the delete behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`DeleteArtifactResponse`](../interfaces/DeleteArtifactResponse.md)\>
|
||||||
|
|
||||||
|
single DeleteArtifactResponse object
|
||||||
|
|
||||||
|
#### Implementation of
|
||||||
|
|
||||||
|
[ArtifactClient](../interfaces/ArtifactClient.md).[deleteArtifact](../interfaces/ArtifactClient.md#deleteartifact)
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:248](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L248)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
### downloadArtifact
|
### downloadArtifact
|
||||||
|
|
||||||
▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](../interfaces/DownloadArtifactResponse.md)\>
|
▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](../interfaces/DownloadArtifactResponse.md)\>
|
||||||
@@ -45,7 +77,7 @@ If `options.findBy` is specified, this will use the public Download Artifact API
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| :------ | :------ | :------ |
|
| :------ | :------ | :------ |
|
||||||
| `artifactId` | `number` | The name of the artifact to download |
|
| `artifactId` | `number` | The id of the artifact to download |
|
||||||
| `options?` | [`DownloadArtifactOptions`](../interfaces/DownloadArtifactOptions.md) & [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the download behavior |
|
| `options?` | [`DownloadArtifactOptions`](../interfaces/DownloadArtifactOptions.md) & [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the download behavior |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
@@ -60,7 +92,7 @@ single DownloadArtifactResponse object
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/client.ts:119](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L119)
|
[src/internal/client.ts:138](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L138)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -95,7 +127,7 @@ If there are multiple artifacts with the same name in the same workflow run this
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/client.ts:193](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L193)
|
[src/internal/client.ts:212](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L212)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -127,7 +159,7 @@ ListArtifactResponse object
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/client.ts:157](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L157)
|
[src/internal/client.ts:176](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L176)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -158,4 +190,4 @@ single UploadArtifactResponse object
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/client.ts:94](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L94)
|
[src/internal/client.ts:113](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L113)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Error.constructor
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/errors.ts:4](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L4)
|
[src/internal/shared/errors.ts:4](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L4)
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ Error.constructor
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/errors.ts:2](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L2)
|
[src/internal/shared/errors.ts:2](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L2)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ Error.constructor
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/errors.ts:31](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L31)
|
[src/internal/shared/errors.ts:31](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L31)
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ Error.constructor
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/errors.ts:17](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L17)
|
[src/internal/shared/errors.ts:17](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L17)
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,201 @@
|
|||||||
|
[@actions/artifact](../README.md) / NetworkError
|
||||||
|
|
||||||
|
# Class: NetworkError
|
||||||
|
|
||||||
|
## Hierarchy
|
||||||
|
|
||||||
|
- `Error`
|
||||||
|
|
||||||
|
↳ **`NetworkError`**
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Constructors
|
||||||
|
|
||||||
|
- [constructor](NetworkError.md#constructor)
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [code](NetworkError.md#code)
|
||||||
|
- [message](NetworkError.md#message)
|
||||||
|
- [name](NetworkError.md#name)
|
||||||
|
- [stack](NetworkError.md#stack)
|
||||||
|
- [prepareStackTrace](NetworkError.md#preparestacktrace)
|
||||||
|
- [stackTraceLimit](NetworkError.md#stacktracelimit)
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [captureStackTrace](NetworkError.md#capturestacktrace)
|
||||||
|
- [isNetworkErrorCode](NetworkError.md#isnetworkerrorcode)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
### constructor
|
||||||
|
|
||||||
|
• **new NetworkError**(`code`): [`NetworkError`](NetworkError.md)
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `code` | `string` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
[`NetworkError`](NetworkError.md)
|
||||||
|
|
||||||
|
#### Overrides
|
||||||
|
|
||||||
|
Error.constructor
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:42](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L42)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### code
|
||||||
|
|
||||||
|
• **code**: `string`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:40](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L40)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### message
|
||||||
|
|
||||||
|
• **message**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.message
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1068
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
• **name**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.name
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1067
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stack
|
||||||
|
|
||||||
|
• `Optional` **stack**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stack
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1069
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### prepareStackTrace
|
||||||
|
|
||||||
|
▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`err`, `stackTraces`): `any`
|
||||||
|
|
||||||
|
Optional override for formatting stack traces
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `err` | `Error` |
|
||||||
|
| `stackTraces` | `CallSite`[] |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`any`
|
||||||
|
|
||||||
|
**`See`**
|
||||||
|
|
||||||
|
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.prepareStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:11
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stackTraceLimit
|
||||||
|
|
||||||
|
▪ `Static` **stackTraceLimit**: `number`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stackTraceLimit
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:13
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### captureStackTrace
|
||||||
|
|
||||||
|
▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
||||||
|
|
||||||
|
Create .stack property on a target object
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `targetObject` | `object` |
|
||||||
|
| `constructorOpt?` | `Function` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.captureStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:4
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### isNetworkErrorCode
|
||||||
|
|
||||||
|
▸ **isNetworkErrorCode**(`code?`): `boolean`
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `code?` | `string` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`boolean`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:49](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L49)
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
[@actions/artifact](../README.md) / UsageError
|
||||||
|
|
||||||
|
# Class: UsageError
|
||||||
|
|
||||||
|
## Hierarchy
|
||||||
|
|
||||||
|
- `Error`
|
||||||
|
|
||||||
|
↳ **`UsageError`**
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Constructors
|
||||||
|
|
||||||
|
- [constructor](UsageError.md#constructor)
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [message](UsageError.md#message)
|
||||||
|
- [name](UsageError.md#name)
|
||||||
|
- [stack](UsageError.md#stack)
|
||||||
|
- [prepareStackTrace](UsageError.md#preparestacktrace)
|
||||||
|
- [stackTraceLimit](UsageError.md#stacktracelimit)
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [captureStackTrace](UsageError.md#capturestacktrace)
|
||||||
|
- [isUsageErrorMessage](UsageError.md#isusageerrormessage)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
### constructor
|
||||||
|
|
||||||
|
• **new UsageError**(): [`UsageError`](UsageError.md)
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
[`UsageError`](UsageError.md)
|
||||||
|
|
||||||
|
#### Overrides
|
||||||
|
|
||||||
|
Error.constructor
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:62](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L62)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### message
|
||||||
|
|
||||||
|
• **message**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.message
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1068
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### name
|
||||||
|
|
||||||
|
• **name**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.name
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1067
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stack
|
||||||
|
|
||||||
|
• `Optional` **stack**: `string`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stack
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/typescript/lib/lib.es5.d.ts:1069
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### prepareStackTrace
|
||||||
|
|
||||||
|
▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
|
||||||
|
|
||||||
|
#### Type declaration
|
||||||
|
|
||||||
|
▸ (`err`, `stackTraces`): `any`
|
||||||
|
|
||||||
|
Optional override for formatting stack traces
|
||||||
|
|
||||||
|
##### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `err` | `Error` |
|
||||||
|
| `stackTraces` | `CallSite`[] |
|
||||||
|
|
||||||
|
##### Returns
|
||||||
|
|
||||||
|
`any`
|
||||||
|
|
||||||
|
**`See`**
|
||||||
|
|
||||||
|
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.prepareStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:11
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### stackTraceLimit
|
||||||
|
|
||||||
|
▪ `Static` **stackTraceLimit**: `number`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.stackTraceLimit
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:13
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
### captureStackTrace
|
||||||
|
|
||||||
|
▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
||||||
|
|
||||||
|
Create .stack property on a target object
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `targetObject` | `object` |
|
||||||
|
| `constructorOpt?` | `Function` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`void`
|
||||||
|
|
||||||
|
#### Inherited from
|
||||||
|
|
||||||
|
Error.captureStackTrace
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
node_modules/@types/node/globals.d.ts:4
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
### isUsageErrorMessage
|
||||||
|
|
||||||
|
▸ **isUsageErrorMessage**(`msg?`): `boolean`
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| :------ | :------ |
|
||||||
|
| `msg?` | `string` |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`boolean`
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/errors.ts:68](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/errors.ts#L68)
|
||||||
@@ -23,7 +23,7 @@ The time when the artifact was created
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:123](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L123)
|
[src/internal/shared/interfaces.ts:128](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L128)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ The ID of the artifact
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:113](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L113)
|
[src/internal/shared/interfaces.ts:118](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L118)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ The name of the artifact
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:108](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L108)
|
[src/internal/shared/interfaces.ts:113](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L113)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -59,4 +59,4 @@ The size of the artifact in bytes
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:118](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L118)
|
[src/internal/shared/interfaces.ts:123](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L123)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Generic interface for the artifact client.
|
|||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
|
|
||||||
|
- [deleteArtifact](ArtifactClient.md#deleteartifact)
|
||||||
- [downloadArtifact](ArtifactClient.md#downloadartifact)
|
- [downloadArtifact](ArtifactClient.md#downloadartifact)
|
||||||
- [getArtifact](ArtifactClient.md#getartifact)
|
- [getArtifact](ArtifactClient.md#getartifact)
|
||||||
- [listArtifacts](ArtifactClient.md#listartifacts)
|
- [listArtifacts](ArtifactClient.md#listartifacts)
|
||||||
@@ -19,6 +20,33 @@ Generic interface for the artifact client.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
### deleteArtifact
|
||||||
|
|
||||||
|
▸ **deleteArtifact**(`artifactName`, `options?`): `Promise`\<[`DeleteArtifactResponse`](DeleteArtifactResponse.md)\>
|
||||||
|
|
||||||
|
Delete an Artifact
|
||||||
|
|
||||||
|
If `options.findBy` is specified, this will use the public Delete Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| :------ | :------ | :------ |
|
||||||
|
| `artifactName` | `string` | The name of the artifact to delete |
|
||||||
|
| `options?` | [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the delete behavior |
|
||||||
|
|
||||||
|
#### Returns
|
||||||
|
|
||||||
|
`Promise`\<[`DeleteArtifactResponse`](DeleteArtifactResponse.md)\>
|
||||||
|
|
||||||
|
single DeleteArtifactResponse object
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/client.ts:103](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L103)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
### downloadArtifact
|
### downloadArtifact
|
||||||
|
|
||||||
▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](DownloadArtifactResponse.md)\>
|
▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](DownloadArtifactResponse.md)\>
|
||||||
@@ -31,7 +59,7 @@ If `options.findBy` is specified, this will use the public Download Artifact API
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| :------ | :------ | :------ |
|
| :------ | :------ | :------ |
|
||||||
| `artifactId` | `number` | The name of the artifact to download |
|
| `artifactId` | `number` | The id of the artifact to download |
|
||||||
| `options?` | [`DownloadArtifactOptions`](DownloadArtifactOptions.md) & [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the download behavior |
|
| `options?` | [`DownloadArtifactOptions`](DownloadArtifactOptions.md) & [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the download behavior |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
@@ -42,7 +70,7 @@ single DownloadArtifactResponse object
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/client.ts:84](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L84)
|
[src/internal/client.ts:89](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L89)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -73,7 +101,7 @@ If there are multiple artifacts with the same name in the same workflow run this
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/client.ts:70](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L70)
|
[src/internal/client.ts:75](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L75)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -101,7 +129,7 @@ ListArtifactResponse object
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/client.ts:52](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L52)
|
[src/internal/client.ts:57](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L57)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -128,4 +156,4 @@ single UploadArtifactResponse object
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/client.ts:35](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L35)
|
[src/internal/client.ts:40](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/client.ts#L40)
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[@actions/artifact](../README.md) / DeleteArtifactResponse
|
||||||
|
|
||||||
|
# Interface: DeleteArtifactResponse
|
||||||
|
|
||||||
|
Response from the server when deleting an artifact
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
- [id](DeleteArtifactResponse.md#id)
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
### id
|
||||||
|
|
||||||
|
• **id**: `number`
|
||||||
|
|
||||||
|
The id of the artifact that was deleted
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:163](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L163)
|
||||||
@@ -20,4 +20,4 @@ Denotes where the artifact will be downloaded to. If not specified then the arti
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:98](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L98)
|
[src/internal/shared/interfaces.ts:103](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L103)
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ The path where the artifact was downloaded to
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:88](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L88)
|
[src/internal/shared/interfaces.ts:93](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L93)
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ The criteria for finding Artifact(s) out of the scope of the current run.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:131](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L131)
|
[src/internal/shared/interfaces.ts:136](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L136)
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ Metadata about the artifact that was found
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:57](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L57)
|
[src/internal/shared/interfaces.ts:62](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L62)
|
||||||
|
|||||||
@@ -21,4 +21,4 @@ In the case of reruns, this can be useful to avoid duplicates
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:68](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L68)
|
[src/internal/shared/interfaces.ts:73](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L73)
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ A list of artifacts that were found
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:78](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L78)
|
[src/internal/shared/interfaces.ts:83](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L83)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ For large files that are not easily compressed, a value of 0 is recommended for
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:47](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L47)
|
[src/internal/shared/interfaces.ts:52](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L52)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -52,4 +52,4 @@ input of 0 assumes default retention setting.
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:36](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L36)
|
[src/internal/shared/interfaces.ts:41](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L41)
|
||||||
|
|||||||
@@ -8,11 +8,24 @@ Response from the server when an artifact is uploaded
|
|||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
|
- [digest](UploadArtifactResponse.md#digest)
|
||||||
- [id](UploadArtifactResponse.md#id)
|
- [id](UploadArtifactResponse.md#id)
|
||||||
- [size](UploadArtifactResponse.md#size)
|
- [size](UploadArtifactResponse.md#size)
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
### digest
|
||||||
|
|
||||||
|
• `Optional` **digest**: `string`
|
||||||
|
|
||||||
|
The SHA256 digest of the artifact that was created. Not provided if no artifact was uploaded
|
||||||
|
|
||||||
|
#### Defined in
|
||||||
|
|
||||||
|
[src/internal/shared/interfaces.ts:19](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L19)
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
### id
|
### id
|
||||||
|
|
||||||
• `Optional` **id**: `number`
|
• `Optional` **id**: `number`
|
||||||
@@ -22,7 +35,7 @@ This ID can be used as input to other APIs to download, delete or get more infor
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:14](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L14)
|
[src/internal/shared/interfaces.ts:14](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L14)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -34,4 +47,4 @@ Total size of the artifact in bytes. Not provided if no artifact was uploaded
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[src/internal/shared/interfaces.ts:8](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L8)
|
[src/internal/shared/interfaces.ts:8](https://github.com/actions/toolkit/blob/f522fdf/packages/artifact/src/internal/shared/interfaces.ts#L8)
|
||||||
|
|||||||
Generated
+1319
-856
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.0.1",
|
"version": "6.0.0",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions artifact lib",
|
"description": "Actions artifact lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -10,8 +10,15 @@
|
|||||||
],
|
],
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/main/packages/artifact",
|
"homepage": "https://github.com/actions/toolkit/tree/main/packages/artifact",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"type": "module",
|
||||||
"main": "lib/artifact.js",
|
"main": "lib/artifact.js",
|
||||||
"types": "lib/artifact.d.ts",
|
"types": "lib/artifact.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./lib/artifact.d.ts",
|
||||||
|
"import": "./lib/artifact.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "lib",
|
"lib": "lib",
|
||||||
"test": "__tests__"
|
"test": "__tests__"
|
||||||
@@ -32,7 +39,7 @@
|
|||||||
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||||
"test": "cd ../../ && npm run test ./packages/artifact",
|
"test": "cd ../../ && npm run test ./packages/artifact",
|
||||||
"bootstrap": "cd ../../ && npm run bootstrap",
|
"bootstrap": "cd ../../ && npm run bootstrap",
|
||||||
"tsc-run": "tsc",
|
"tsc-run": "tsc && cp src/internal/shared/package-version.cjs lib/internal/shared/",
|
||||||
"tsc": "npm run bootstrap && npm run tsc-run",
|
"tsc": "npm run bootstrap && npm run tsc-run",
|
||||||
"gen:docs": "typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none"
|
"gen:docs": "typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none"
|
||||||
},
|
},
|
||||||
@@ -40,26 +47,30 @@
|
|||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^3.0.0",
|
||||||
"@actions/github": "^5.1.1",
|
"@actions/github": "^9.0.0",
|
||||||
"@actions/http-client": "^2.1.0",
|
"@actions/http-client": "^4.0.0",
|
||||||
"@azure/storage-blob": "^12.15.0",
|
"@azure/storage-blob": "^12.30.0",
|
||||||
"@octokit/core": "^3.5.1",
|
"@octokit/core": "^7.0.6",
|
||||||
"@octokit/plugin-request-log": "^1.0.4",
|
"@octokit/plugin-request-log": "^6.0.0",
|
||||||
"@octokit/plugin-retry": "^3.0.9",
|
"@octokit/plugin-retry": "^8.0.0",
|
||||||
"@octokit/request-error": "^5.0.0",
|
"@octokit/request": "^10.0.7",
|
||||||
|
"@octokit/request-error": "^7.1.0",
|
||||||
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
||||||
"archiver": "^5.3.1",
|
"@protobuf-ts/runtime": "^2.9.4",
|
||||||
"crypto": "^1.0.1",
|
"archiver": "^7.0.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^4.0.0",
|
||||||
"twirp-ts": "^2.5.0",
|
|
||||||
"unzip-stream": "^0.3.1"
|
"unzip-stream": "^0.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.3.2",
|
"@types/archiver": "^7.0.0",
|
||||||
"@types/unzip-stream": "^0.3.4",
|
"@types/unzip-stream": "^0.3.4",
|
||||||
"typedoc": "^0.25.4",
|
"typedoc": "^0.28.16",
|
||||||
"typedoc-plugin-markdown": "^3.17.1",
|
"typedoc-plugin-markdown": "^4.9.0",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.9.3"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"uri-js": "npm:uri-js-replace@^1.0.1",
|
||||||
|
"node-fetch": "^3.3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import {ArtifactClient, DefaultArtifactClient} from './internal/client'
|
import {ArtifactClient, DefaultArtifactClient} from './internal/client.js'
|
||||||
|
|
||||||
export * from './internal/shared/interfaces'
|
export * from './internal/shared/interfaces.js'
|
||||||
export * from './internal/shared/errors'
|
export * from './internal/shared/errors.js'
|
||||||
export * from './internal/client'
|
export * from './internal/client.js'
|
||||||
|
|
||||||
const client: ArtifactClient = new DefaultArtifactClient()
|
const client: ArtifactClient = new DefaultArtifactClient()
|
||||||
export default client
|
export default client
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export * from './google/protobuf/timestamp'
|
export * from './google/protobuf/timestamp.js'
|
||||||
export * from './google/protobuf/wrappers'
|
export * from './google/protobuf/wrappers.js'
|
||||||
export * from './results/api/v1/artifact'
|
export * from './results/api/v1/artifact.js'
|
||||||
export * from './results/api/v1/artifact.twirp'
|
export * from './results/api/v1/artifact.twirp-client.js'
|
||||||
|
|||||||
@@ -12,9 +12,69 @@ import type { PartialMessage } from "@protobuf-ts/runtime";
|
|||||||
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||||
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
|
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
|
||||||
import { MessageType } from "@protobuf-ts/runtime";
|
import { MessageType } from "@protobuf-ts/runtime";
|
||||||
import { Int64Value } from "../../../google/protobuf/wrappers";
|
import { Int64Value } from "../../../google/protobuf/wrappers.js";
|
||||||
import { StringValue } from "../../../google/protobuf/wrappers";
|
import { StringValue } from "../../../google/protobuf/wrappers.js";
|
||||||
import { Timestamp } from "../../../google/protobuf/timestamp";
|
import { Timestamp } from "../../../google/protobuf/timestamp.js";
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.MigrateArtifactRequest
|
||||||
|
*/
|
||||||
|
export interface MigrateArtifactRequest {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string workflow_run_backend_id = 1;
|
||||||
|
*/
|
||||||
|
workflowRunBackendId: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string name = 2;
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: google.protobuf.Timestamp expires_at = 3;
|
||||||
|
*/
|
||||||
|
expiresAt?: Timestamp;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.MigrateArtifactResponse
|
||||||
|
*/
|
||||||
|
export interface MigrateArtifactResponse {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: bool ok = 1;
|
||||||
|
*/
|
||||||
|
ok: boolean;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string signed_upload_url = 2;
|
||||||
|
*/
|
||||||
|
signedUploadUrl: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.FinalizeMigratedArtifactRequest
|
||||||
|
*/
|
||||||
|
export interface FinalizeMigratedArtifactRequest {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string workflow_run_backend_id = 1;
|
||||||
|
*/
|
||||||
|
workflowRunBackendId: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string name = 2;
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: int64 size = 3;
|
||||||
|
*/
|
||||||
|
size: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.FinalizeMigratedArtifactResponse
|
||||||
|
*/
|
||||||
|
export interface FinalizeMigratedArtifactResponse {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: bool ok = 1;
|
||||||
|
*/
|
||||||
|
ok: boolean;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: int64 artifact_id = 2;
|
||||||
|
*/
|
||||||
|
artifactId: string;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message github.actions.results.api.v1.CreateArtifactRequest
|
* @generated from protobuf message github.actions.results.api.v1.CreateArtifactRequest
|
||||||
*/
|
*/
|
||||||
@@ -169,6 +229,12 @@ export interface ListArtifactsResponse_MonolithArtifact {
|
|||||||
* @generated from protobuf field: google.protobuf.Timestamp created_at = 6;
|
* @generated from protobuf field: google.protobuf.Timestamp created_at = 6;
|
||||||
*/
|
*/
|
||||||
createdAt?: Timestamp;
|
createdAt?: Timestamp;
|
||||||
|
/**
|
||||||
|
* The SHA-256 digest of the artifact, calculated on upload for upload-artifact v4 & newer
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: google.protobuf.StringValue digest = 7;
|
||||||
|
*/
|
||||||
|
digest?: StringValue;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @generated from protobuf message github.actions.results.api.v1.GetSignedArtifactURLRequest
|
* @generated from protobuf message github.actions.results.api.v1.GetSignedArtifactURLRequest
|
||||||
@@ -196,6 +262,266 @@ export interface GetSignedArtifactURLResponse {
|
|||||||
*/
|
*/
|
||||||
signedUrl: string;
|
signedUrl: string;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.DeleteArtifactRequest
|
||||||
|
*/
|
||||||
|
export interface DeleteArtifactRequest {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string workflow_run_backend_id = 1;
|
||||||
|
*/
|
||||||
|
workflowRunBackendId: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string workflow_job_run_backend_id = 2;
|
||||||
|
*/
|
||||||
|
workflowJobRunBackendId: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string name = 3;
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.DeleteArtifactResponse
|
||||||
|
*/
|
||||||
|
export interface DeleteArtifactResponse {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: bool ok = 1;
|
||||||
|
*/
|
||||||
|
ok: boolean;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: int64 artifact_id = 2;
|
||||||
|
*/
|
||||||
|
artifactId: string;
|
||||||
|
}
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class MigrateArtifactRequest$Type extends MessageType<MigrateArtifactRequest> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.MigrateArtifactRequest", [
|
||||||
|
{ no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 3, name: "expires_at", kind: "message", T: () => Timestamp }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<MigrateArtifactRequest>): MigrateArtifactRequest {
|
||||||
|
const message = { workflowRunBackendId: "", name: "" };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<MigrateArtifactRequest>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MigrateArtifactRequest): MigrateArtifactRequest {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* string workflow_run_backend_id */ 1:
|
||||||
|
message.workflowRunBackendId = reader.string();
|
||||||
|
break;
|
||||||
|
case /* string name */ 2:
|
||||||
|
message.name = reader.string();
|
||||||
|
break;
|
||||||
|
case /* google.protobuf.Timestamp expires_at */ 3:
|
||||||
|
message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: MigrateArtifactRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* string workflow_run_backend_id = 1; */
|
||||||
|
if (message.workflowRunBackendId !== "")
|
||||||
|
writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId);
|
||||||
|
/* string name = 2; */
|
||||||
|
if (message.name !== "")
|
||||||
|
writer.tag(2, WireType.LengthDelimited).string(message.name);
|
||||||
|
/* google.protobuf.Timestamp expires_at = 3; */
|
||||||
|
if (message.expiresAt)
|
||||||
|
Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.MigrateArtifactRequest
|
||||||
|
*/
|
||||||
|
export const MigrateArtifactRequest = new MigrateArtifactRequest$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class MigrateArtifactResponse$Type extends MessageType<MigrateArtifactResponse> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.MigrateArtifactResponse", [
|
||||||
|
{ no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
||||||
|
{ no: 2, name: "signed_upload_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<MigrateArtifactResponse>): MigrateArtifactResponse {
|
||||||
|
const message = { ok: false, signedUploadUrl: "" };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<MigrateArtifactResponse>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MigrateArtifactResponse): MigrateArtifactResponse {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* bool ok */ 1:
|
||||||
|
message.ok = reader.bool();
|
||||||
|
break;
|
||||||
|
case /* string signed_upload_url */ 2:
|
||||||
|
message.signedUploadUrl = reader.string();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: MigrateArtifactResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* bool ok = 1; */
|
||||||
|
if (message.ok !== false)
|
||||||
|
writer.tag(1, WireType.Varint).bool(message.ok);
|
||||||
|
/* string signed_upload_url = 2; */
|
||||||
|
if (message.signedUploadUrl !== "")
|
||||||
|
writer.tag(2, WireType.LengthDelimited).string(message.signedUploadUrl);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.MigrateArtifactResponse
|
||||||
|
*/
|
||||||
|
export const MigrateArtifactResponse = new MigrateArtifactResponse$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class FinalizeMigratedArtifactRequest$Type extends MessageType<FinalizeMigratedArtifactRequest> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [
|
||||||
|
{ no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 3, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<FinalizeMigratedArtifactRequest>): FinalizeMigratedArtifactRequest {
|
||||||
|
const message = { workflowRunBackendId: "", name: "", size: "0" };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<FinalizeMigratedArtifactRequest>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FinalizeMigratedArtifactRequest): FinalizeMigratedArtifactRequest {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* string workflow_run_backend_id */ 1:
|
||||||
|
message.workflowRunBackendId = reader.string();
|
||||||
|
break;
|
||||||
|
case /* string name */ 2:
|
||||||
|
message.name = reader.string();
|
||||||
|
break;
|
||||||
|
case /* int64 size */ 3:
|
||||||
|
message.size = reader.int64().toString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: FinalizeMigratedArtifactRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* string workflow_run_backend_id = 1; */
|
||||||
|
if (message.workflowRunBackendId !== "")
|
||||||
|
writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId);
|
||||||
|
/* string name = 2; */
|
||||||
|
if (message.name !== "")
|
||||||
|
writer.tag(2, WireType.LengthDelimited).string(message.name);
|
||||||
|
/* int64 size = 3; */
|
||||||
|
if (message.size !== "0")
|
||||||
|
writer.tag(3, WireType.Varint).int64(message.size);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.FinalizeMigratedArtifactRequest
|
||||||
|
*/
|
||||||
|
export const FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class FinalizeMigratedArtifactResponse$Type extends MessageType<FinalizeMigratedArtifactResponse> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [
|
||||||
|
{ no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
||||||
|
{ no: 2, name: "artifact_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<FinalizeMigratedArtifactResponse>): FinalizeMigratedArtifactResponse {
|
||||||
|
const message = { ok: false, artifactId: "0" };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<FinalizeMigratedArtifactResponse>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FinalizeMigratedArtifactResponse): FinalizeMigratedArtifactResponse {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* bool ok */ 1:
|
||||||
|
message.ok = reader.bool();
|
||||||
|
break;
|
||||||
|
case /* int64 artifact_id */ 2:
|
||||||
|
message.artifactId = reader.int64().toString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: FinalizeMigratedArtifactResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* bool ok = 1; */
|
||||||
|
if (message.ok !== false)
|
||||||
|
writer.tag(1, WireType.Varint).bool(message.ok);
|
||||||
|
/* int64 artifact_id = 2; */
|
||||||
|
if (message.artifactId !== "0")
|
||||||
|
writer.tag(2, WireType.Varint).int64(message.artifactId);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.FinalizeMigratedArtifactResponse
|
||||||
|
*/
|
||||||
|
export const FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type();
|
||||||
// @generated message type with reflection information, may provide speed optimized methods
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
class CreateArtifactRequest$Type extends MessageType<CreateArtifactRequest> {
|
class CreateArtifactRequest$Type extends MessageType<CreateArtifactRequest> {
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -578,7 +904,8 @@ class ListArtifactsResponse_MonolithArtifact$Type extends MessageType<ListArtifa
|
|||||||
{ no: 3, name: "database_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
|
{ no: 3, name: "database_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
|
||||||
{ no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
{ no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
{ no: 5, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
|
{ no: 5, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
|
||||||
{ no: 6, name: "created_at", kind: "message", T: () => Timestamp }
|
{ no: 6, name: "created_at", kind: "message", T: () => Timestamp },
|
||||||
|
{ no: 7, name: "digest", kind: "message", T: () => StringValue }
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
create(value?: PartialMessage<ListArtifactsResponse_MonolithArtifact>): ListArtifactsResponse_MonolithArtifact {
|
create(value?: PartialMessage<ListArtifactsResponse_MonolithArtifact>): ListArtifactsResponse_MonolithArtifact {
|
||||||
@@ -611,6 +938,9 @@ class ListArtifactsResponse_MonolithArtifact$Type extends MessageType<ListArtifa
|
|||||||
case /* google.protobuf.Timestamp created_at */ 6:
|
case /* google.protobuf.Timestamp created_at */ 6:
|
||||||
message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
|
message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
|
||||||
break;
|
break;
|
||||||
|
case /* google.protobuf.StringValue digest */ 7:
|
||||||
|
message.digest = StringValue.internalBinaryRead(reader, reader.uint32(), options, message.digest);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
let u = options.readUnknownField;
|
let u = options.readUnknownField;
|
||||||
if (u === "throw")
|
if (u === "throw")
|
||||||
@@ -641,6 +971,9 @@ class ListArtifactsResponse_MonolithArtifact$Type extends MessageType<ListArtifa
|
|||||||
/* google.protobuf.Timestamp created_at = 6; */
|
/* google.protobuf.Timestamp created_at = 6; */
|
||||||
if (message.createdAt)
|
if (message.createdAt)
|
||||||
Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
|
Timestamp.internalBinaryWrite(message.createdAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
|
||||||
|
/* google.protobuf.StringValue digest = 7; */
|
||||||
|
if (message.digest)
|
||||||
|
StringValue.internalBinaryWrite(message.digest, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
|
||||||
let u = options.writeUnknownFields;
|
let u = options.writeUnknownFields;
|
||||||
if (u !== false)
|
if (u !== false)
|
||||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
@@ -759,6 +1092,121 @@ class GetSignedArtifactURLResponse$Type extends MessageType<GetSignedArtifactURL
|
|||||||
* @generated MessageType for protobuf message github.actions.results.api.v1.GetSignedArtifactURLResponse
|
* @generated MessageType for protobuf message github.actions.results.api.v1.GetSignedArtifactURLResponse
|
||||||
*/
|
*/
|
||||||
export const GetSignedArtifactURLResponse = new GetSignedArtifactURLResponse$Type();
|
export const GetSignedArtifactURLResponse = new GetSignedArtifactURLResponse$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class DeleteArtifactRequest$Type extends MessageType<DeleteArtifactRequest> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.DeleteArtifactRequest", [
|
||||||
|
{ no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<DeleteArtifactRequest>): DeleteArtifactRequest {
|
||||||
|
const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<DeleteArtifactRequest>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteArtifactRequest): DeleteArtifactRequest {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* string workflow_run_backend_id */ 1:
|
||||||
|
message.workflowRunBackendId = reader.string();
|
||||||
|
break;
|
||||||
|
case /* string workflow_job_run_backend_id */ 2:
|
||||||
|
message.workflowJobRunBackendId = reader.string();
|
||||||
|
break;
|
||||||
|
case /* string name */ 3:
|
||||||
|
message.name = reader.string();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: DeleteArtifactRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* string workflow_run_backend_id = 1; */
|
||||||
|
if (message.workflowRunBackendId !== "")
|
||||||
|
writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId);
|
||||||
|
/* string workflow_job_run_backend_id = 2; */
|
||||||
|
if (message.workflowJobRunBackendId !== "")
|
||||||
|
writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId);
|
||||||
|
/* string name = 3; */
|
||||||
|
if (message.name !== "")
|
||||||
|
writer.tag(3, WireType.LengthDelimited).string(message.name);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.DeleteArtifactRequest
|
||||||
|
*/
|
||||||
|
export const DeleteArtifactRequest = new DeleteArtifactRequest$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class DeleteArtifactResponse$Type extends MessageType<DeleteArtifactResponse> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.DeleteArtifactResponse", [
|
||||||
|
{ no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
||||||
|
{ no: 2, name: "artifact_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<DeleteArtifactResponse>): DeleteArtifactResponse {
|
||||||
|
const message = { ok: false, artifactId: "0" };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<DeleteArtifactResponse>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteArtifactResponse): DeleteArtifactResponse {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* bool ok */ 1:
|
||||||
|
message.ok = reader.bool();
|
||||||
|
break;
|
||||||
|
case /* int64 artifact_id */ 2:
|
||||||
|
message.artifactId = reader.int64().toString();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: DeleteArtifactResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* bool ok = 1; */
|
||||||
|
if (message.ok !== false)
|
||||||
|
writer.tag(1, WireType.Varint).bool(message.ok);
|
||||||
|
/* int64 artifact_id = 2; */
|
||||||
|
if (message.artifactId !== "0")
|
||||||
|
writer.tag(2, WireType.Varint).int64(message.artifactId);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.DeleteArtifactResponse
|
||||||
|
*/
|
||||||
|
export const DeleteArtifactResponse = new DeleteArtifactResponse$Type();
|
||||||
/**
|
/**
|
||||||
* @generated ServiceType for protobuf service github.actions.results.api.v1.ArtifactService
|
* @generated ServiceType for protobuf service github.actions.results.api.v1.ArtifactService
|
||||||
*/
|
*/
|
||||||
@@ -766,5 +1214,8 @@ export const ArtifactService = new ServiceType("github.actions.results.api.v1.Ar
|
|||||||
{ name: "CreateArtifact", options: {}, I: CreateArtifactRequest, O: CreateArtifactResponse },
|
{ name: "CreateArtifact", options: {}, I: CreateArtifactRequest, O: CreateArtifactResponse },
|
||||||
{ name: "FinalizeArtifact", options: {}, I: FinalizeArtifactRequest, O: FinalizeArtifactResponse },
|
{ name: "FinalizeArtifact", options: {}, I: FinalizeArtifactRequest, O: FinalizeArtifactResponse },
|
||||||
{ name: "ListArtifacts", options: {}, I: ListArtifactsRequest, O: ListArtifactsResponse },
|
{ name: "ListArtifacts", options: {}, I: ListArtifactsRequest, O: ListArtifactsResponse },
|
||||||
{ name: "GetSignedArtifactURL", options: {}, I: GetSignedArtifactURLRequest, O: GetSignedArtifactURLResponse }
|
{ name: "GetSignedArtifactURL", options: {}, I: GetSignedArtifactURLRequest, O: GetSignedArtifactURLResponse },
|
||||||
|
{ name: "DeleteArtifact", options: {}, I: DeleteArtifactRequest, O: DeleteArtifactResponse },
|
||||||
|
{ name: "MigrateArtifact", options: {}, I: MigrateArtifactRequest, O: MigrateArtifactResponse },
|
||||||
|
{ name: "FinalizeMigratedArtifact", options: {}, I: FinalizeMigratedArtifactRequest, O: FinalizeMigratedArtifactResponse }
|
||||||
]);
|
]);
|
||||||
@@ -0,0 +1,232 @@
|
|||||||
|
import {
|
||||||
|
CreateArtifactRequest,
|
||||||
|
CreateArtifactResponse,
|
||||||
|
FinalizeArtifactRequest,
|
||||||
|
FinalizeArtifactResponse,
|
||||||
|
ListArtifactsRequest,
|
||||||
|
ListArtifactsResponse,
|
||||||
|
GetSignedArtifactURLRequest,
|
||||||
|
GetSignedArtifactURLResponse,
|
||||||
|
DeleteArtifactRequest,
|
||||||
|
DeleteArtifactResponse,
|
||||||
|
} from "./artifact.js";
|
||||||
|
|
||||||
|
//==================================//
|
||||||
|
// Client Code //
|
||||||
|
//==================================//
|
||||||
|
|
||||||
|
interface Rpc {
|
||||||
|
request(
|
||||||
|
service: string,
|
||||||
|
method: string,
|
||||||
|
contentType: "application/json" | "application/protobuf",
|
||||||
|
data: object | Uint8Array
|
||||||
|
): Promise<object | Uint8Array>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ArtifactServiceClient {
|
||||||
|
CreateArtifact(
|
||||||
|
request: CreateArtifactRequest
|
||||||
|
): Promise<CreateArtifactResponse>;
|
||||||
|
FinalizeArtifact(
|
||||||
|
request: FinalizeArtifactRequest
|
||||||
|
): Promise<FinalizeArtifactResponse>;
|
||||||
|
ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse>;
|
||||||
|
GetSignedArtifactURL(
|
||||||
|
request: GetSignedArtifactURLRequest
|
||||||
|
): Promise<GetSignedArtifactURLResponse>;
|
||||||
|
DeleteArtifact(
|
||||||
|
request: DeleteArtifactRequest
|
||||||
|
): Promise<DeleteArtifactResponse>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ArtifactServiceClientJSON implements ArtifactServiceClient {
|
||||||
|
private readonly rpc: Rpc;
|
||||||
|
constructor(rpc: Rpc) {
|
||||||
|
this.rpc = rpc;
|
||||||
|
this.CreateArtifact.bind(this);
|
||||||
|
this.FinalizeArtifact.bind(this);
|
||||||
|
this.ListArtifacts.bind(this);
|
||||||
|
this.GetSignedArtifactURL.bind(this);
|
||||||
|
this.DeleteArtifact.bind(this);
|
||||||
|
}
|
||||||
|
CreateArtifact(
|
||||||
|
request: CreateArtifactRequest
|
||||||
|
): Promise<CreateArtifactResponse> {
|
||||||
|
const data = CreateArtifactRequest.toJson(request, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false,
|
||||||
|
});
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"CreateArtifact",
|
||||||
|
"application/json",
|
||||||
|
data as object
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
CreateArtifactResponse.fromJson(data as any, {
|
||||||
|
ignoreUnknownFields: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
FinalizeArtifact(
|
||||||
|
request: FinalizeArtifactRequest
|
||||||
|
): Promise<FinalizeArtifactResponse> {
|
||||||
|
const data = FinalizeArtifactRequest.toJson(request, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false,
|
||||||
|
});
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"FinalizeArtifact",
|
||||||
|
"application/json",
|
||||||
|
data as object
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
FinalizeArtifactResponse.fromJson(data as any, {
|
||||||
|
ignoreUnknownFields: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse> {
|
||||||
|
const data = ListArtifactsRequest.toJson(request, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false,
|
||||||
|
});
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"ListArtifacts",
|
||||||
|
"application/json",
|
||||||
|
data as object
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
ListArtifactsResponse.fromJson(data as any, { ignoreUnknownFields: true })
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetSignedArtifactURL(
|
||||||
|
request: GetSignedArtifactURLRequest
|
||||||
|
): Promise<GetSignedArtifactURLResponse> {
|
||||||
|
const data = GetSignedArtifactURLRequest.toJson(request, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false,
|
||||||
|
});
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"GetSignedArtifactURL",
|
||||||
|
"application/json",
|
||||||
|
data as object
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
GetSignedArtifactURLResponse.fromJson(data as any, {
|
||||||
|
ignoreUnknownFields: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteArtifact(
|
||||||
|
request: DeleteArtifactRequest
|
||||||
|
): Promise<DeleteArtifactResponse> {
|
||||||
|
const data = DeleteArtifactRequest.toJson(request, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false,
|
||||||
|
});
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"DeleteArtifact",
|
||||||
|
"application/json",
|
||||||
|
data as object
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
DeleteArtifactResponse.fromJson(data as any, {
|
||||||
|
ignoreUnknownFields: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ArtifactServiceClientProtobuf implements ArtifactServiceClient {
|
||||||
|
private readonly rpc: Rpc;
|
||||||
|
constructor(rpc: Rpc) {
|
||||||
|
this.rpc = rpc;
|
||||||
|
this.CreateArtifact.bind(this);
|
||||||
|
this.FinalizeArtifact.bind(this);
|
||||||
|
this.ListArtifacts.bind(this);
|
||||||
|
this.GetSignedArtifactURL.bind(this);
|
||||||
|
this.DeleteArtifact.bind(this);
|
||||||
|
}
|
||||||
|
CreateArtifact(
|
||||||
|
request: CreateArtifactRequest
|
||||||
|
): Promise<CreateArtifactResponse> {
|
||||||
|
const data = CreateArtifactRequest.toBinary(request);
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"CreateArtifact",
|
||||||
|
"application/protobuf",
|
||||||
|
data
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
CreateArtifactResponse.fromBinary(data as Uint8Array)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
FinalizeArtifact(
|
||||||
|
request: FinalizeArtifactRequest
|
||||||
|
): Promise<FinalizeArtifactResponse> {
|
||||||
|
const data = FinalizeArtifactRequest.toBinary(request);
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"FinalizeArtifact",
|
||||||
|
"application/protobuf",
|
||||||
|
data
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
FinalizeArtifactResponse.fromBinary(data as Uint8Array)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse> {
|
||||||
|
const data = ListArtifactsRequest.toBinary(request);
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"ListArtifacts",
|
||||||
|
"application/protobuf",
|
||||||
|
data
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
ListArtifactsResponse.fromBinary(data as Uint8Array)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetSignedArtifactURL(
|
||||||
|
request: GetSignedArtifactURLRequest
|
||||||
|
): Promise<GetSignedArtifactURLResponse> {
|
||||||
|
const data = GetSignedArtifactURLRequest.toBinary(request);
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"GetSignedArtifactURL",
|
||||||
|
"application/protobuf",
|
||||||
|
data
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
GetSignedArtifactURLResponse.fromBinary(data as Uint8Array)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteArtifact(
|
||||||
|
request: DeleteArtifactRequest
|
||||||
|
): Promise<DeleteArtifactResponse> {
|
||||||
|
const data = DeleteArtifactRequest.toBinary(request);
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
"github.actions.results.api.v1.ArtifactService",
|
||||||
|
"DeleteArtifact",
|
||||||
|
"application/protobuf",
|
||||||
|
data
|
||||||
|
);
|
||||||
|
return promise.then((data) =>
|
||||||
|
DeleteArtifactResponse.fromBinary(data as Uint8Array)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,799 +0,0 @@
|
|||||||
import {
|
|
||||||
TwirpContext,
|
|
||||||
TwirpServer,
|
|
||||||
RouterEvents,
|
|
||||||
TwirpError,
|
|
||||||
TwirpErrorCode,
|
|
||||||
Interceptor,
|
|
||||||
TwirpContentType,
|
|
||||||
chainInterceptors,
|
|
||||||
} from "twirp-ts";
|
|
||||||
import {
|
|
||||||
CreateArtifactRequest,
|
|
||||||
CreateArtifactResponse,
|
|
||||||
FinalizeArtifactRequest,
|
|
||||||
FinalizeArtifactResponse,
|
|
||||||
ListArtifactsRequest,
|
|
||||||
ListArtifactsResponse,
|
|
||||||
GetSignedArtifactURLRequest,
|
|
||||||
GetSignedArtifactURLResponse,
|
|
||||||
} from "./artifact";
|
|
||||||
|
|
||||||
//==================================//
|
|
||||||
// Client Code //
|
|
||||||
//==================================//
|
|
||||||
|
|
||||||
interface Rpc {
|
|
||||||
request(
|
|
||||||
service: string,
|
|
||||||
method: string,
|
|
||||||
contentType: "application/json" | "application/protobuf",
|
|
||||||
data: object | Uint8Array
|
|
||||||
): Promise<object | Uint8Array>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ArtifactServiceClient {
|
|
||||||
CreateArtifact(
|
|
||||||
request: CreateArtifactRequest
|
|
||||||
): Promise<CreateArtifactResponse>;
|
|
||||||
FinalizeArtifact(
|
|
||||||
request: FinalizeArtifactRequest
|
|
||||||
): Promise<FinalizeArtifactResponse>;
|
|
||||||
ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse>;
|
|
||||||
GetSignedArtifactURL(
|
|
||||||
request: GetSignedArtifactURLRequest
|
|
||||||
): Promise<GetSignedArtifactURLResponse>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ArtifactServiceClientJSON implements ArtifactServiceClient {
|
|
||||||
private readonly rpc: Rpc;
|
|
||||||
constructor(rpc: Rpc) {
|
|
||||||
this.rpc = rpc;
|
|
||||||
this.CreateArtifact.bind(this);
|
|
||||||
this.FinalizeArtifact.bind(this);
|
|
||||||
this.ListArtifacts.bind(this);
|
|
||||||
this.GetSignedArtifactURL.bind(this);
|
|
||||||
}
|
|
||||||
CreateArtifact(
|
|
||||||
request: CreateArtifactRequest
|
|
||||||
): Promise<CreateArtifactResponse> {
|
|
||||||
const data = CreateArtifactRequest.toJson(request, {
|
|
||||||
useProtoFieldName: true,
|
|
||||||
emitDefaultValues: false,
|
|
||||||
});
|
|
||||||
const promise = this.rpc.request(
|
|
||||||
"github.actions.results.api.v1.ArtifactService",
|
|
||||||
"CreateArtifact",
|
|
||||||
"application/json",
|
|
||||||
data as object
|
|
||||||
);
|
|
||||||
return promise.then((data) =>
|
|
||||||
CreateArtifactResponse.fromJson(data as any, {
|
|
||||||
ignoreUnknownFields: true,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
FinalizeArtifact(
|
|
||||||
request: FinalizeArtifactRequest
|
|
||||||
): Promise<FinalizeArtifactResponse> {
|
|
||||||
const data = FinalizeArtifactRequest.toJson(request, {
|
|
||||||
useProtoFieldName: true,
|
|
||||||
emitDefaultValues: false,
|
|
||||||
});
|
|
||||||
const promise = this.rpc.request(
|
|
||||||
"github.actions.results.api.v1.ArtifactService",
|
|
||||||
"FinalizeArtifact",
|
|
||||||
"application/json",
|
|
||||||
data as object
|
|
||||||
);
|
|
||||||
return promise.then((data) =>
|
|
||||||
FinalizeArtifactResponse.fromJson(data as any, {
|
|
||||||
ignoreUnknownFields: true,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse> {
|
|
||||||
const data = ListArtifactsRequest.toJson(request, {
|
|
||||||
useProtoFieldName: true,
|
|
||||||
emitDefaultValues: false,
|
|
||||||
});
|
|
||||||
const promise = this.rpc.request(
|
|
||||||
"github.actions.results.api.v1.ArtifactService",
|
|
||||||
"ListArtifacts",
|
|
||||||
"application/json",
|
|
||||||
data as object
|
|
||||||
);
|
|
||||||
return promise.then((data) =>
|
|
||||||
ListArtifactsResponse.fromJson(data as any, { ignoreUnknownFields: true })
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
GetSignedArtifactURL(
|
|
||||||
request: GetSignedArtifactURLRequest
|
|
||||||
): Promise<GetSignedArtifactURLResponse> {
|
|
||||||
const data = GetSignedArtifactURLRequest.toJson(request, {
|
|
||||||
useProtoFieldName: true,
|
|
||||||
emitDefaultValues: false,
|
|
||||||
});
|
|
||||||
const promise = this.rpc.request(
|
|
||||||
"github.actions.results.api.v1.ArtifactService",
|
|
||||||
"GetSignedArtifactURL",
|
|
||||||
"application/json",
|
|
||||||
data as object
|
|
||||||
);
|
|
||||||
return promise.then((data) =>
|
|
||||||
GetSignedArtifactURLResponse.fromJson(data as any, {
|
|
||||||
ignoreUnknownFields: true,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ArtifactServiceClientProtobuf implements ArtifactServiceClient {
|
|
||||||
private readonly rpc: Rpc;
|
|
||||||
constructor(rpc: Rpc) {
|
|
||||||
this.rpc = rpc;
|
|
||||||
this.CreateArtifact.bind(this);
|
|
||||||
this.FinalizeArtifact.bind(this);
|
|
||||||
this.ListArtifacts.bind(this);
|
|
||||||
this.GetSignedArtifactURL.bind(this);
|
|
||||||
}
|
|
||||||
CreateArtifact(
|
|
||||||
request: CreateArtifactRequest
|
|
||||||
): Promise<CreateArtifactResponse> {
|
|
||||||
const data = CreateArtifactRequest.toBinary(request);
|
|
||||||
const promise = this.rpc.request(
|
|
||||||
"github.actions.results.api.v1.ArtifactService",
|
|
||||||
"CreateArtifact",
|
|
||||||
"application/protobuf",
|
|
||||||
data
|
|
||||||
);
|
|
||||||
return promise.then((data) =>
|
|
||||||
CreateArtifactResponse.fromBinary(data as Uint8Array)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
FinalizeArtifact(
|
|
||||||
request: FinalizeArtifactRequest
|
|
||||||
): Promise<FinalizeArtifactResponse> {
|
|
||||||
const data = FinalizeArtifactRequest.toBinary(request);
|
|
||||||
const promise = this.rpc.request(
|
|
||||||
"github.actions.results.api.v1.ArtifactService",
|
|
||||||
"FinalizeArtifact",
|
|
||||||
"application/protobuf",
|
|
||||||
data
|
|
||||||
);
|
|
||||||
return promise.then((data) =>
|
|
||||||
FinalizeArtifactResponse.fromBinary(data as Uint8Array)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
ListArtifacts(request: ListArtifactsRequest): Promise<ListArtifactsResponse> {
|
|
||||||
const data = ListArtifactsRequest.toBinary(request);
|
|
||||||
const promise = this.rpc.request(
|
|
||||||
"github.actions.results.api.v1.ArtifactService",
|
|
||||||
"ListArtifacts",
|
|
||||||
"application/protobuf",
|
|
||||||
data
|
|
||||||
);
|
|
||||||
return promise.then((data) =>
|
|
||||||
ListArtifactsResponse.fromBinary(data as Uint8Array)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
GetSignedArtifactURL(
|
|
||||||
request: GetSignedArtifactURLRequest
|
|
||||||
): Promise<GetSignedArtifactURLResponse> {
|
|
||||||
const data = GetSignedArtifactURLRequest.toBinary(request);
|
|
||||||
const promise = this.rpc.request(
|
|
||||||
"github.actions.results.api.v1.ArtifactService",
|
|
||||||
"GetSignedArtifactURL",
|
|
||||||
"application/protobuf",
|
|
||||||
data
|
|
||||||
);
|
|
||||||
return promise.then((data) =>
|
|
||||||
GetSignedArtifactURLResponse.fromBinary(data as Uint8Array)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//==================================//
|
|
||||||
// Server Code //
|
|
||||||
//==================================//
|
|
||||||
|
|
||||||
export interface ArtifactServiceTwirp<T extends TwirpContext = TwirpContext> {
|
|
||||||
CreateArtifact(
|
|
||||||
ctx: T,
|
|
||||||
request: CreateArtifactRequest
|
|
||||||
): Promise<CreateArtifactResponse>;
|
|
||||||
FinalizeArtifact(
|
|
||||||
ctx: T,
|
|
||||||
request: FinalizeArtifactRequest
|
|
||||||
): Promise<FinalizeArtifactResponse>;
|
|
||||||
ListArtifacts(
|
|
||||||
ctx: T,
|
|
||||||
request: ListArtifactsRequest
|
|
||||||
): Promise<ListArtifactsResponse>;
|
|
||||||
GetSignedArtifactURL(
|
|
||||||
ctx: T,
|
|
||||||
request: GetSignedArtifactURLRequest
|
|
||||||
): Promise<GetSignedArtifactURLResponse>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ArtifactServiceMethod {
|
|
||||||
CreateArtifact = "CreateArtifact",
|
|
||||||
FinalizeArtifact = "FinalizeArtifact",
|
|
||||||
ListArtifacts = "ListArtifacts",
|
|
||||||
GetSignedArtifactURL = "GetSignedArtifactURL",
|
|
||||||
}
|
|
||||||
|
|
||||||
export const ArtifactServiceMethodList = [
|
|
||||||
ArtifactServiceMethod.CreateArtifact,
|
|
||||||
ArtifactServiceMethod.FinalizeArtifact,
|
|
||||||
ArtifactServiceMethod.ListArtifacts,
|
|
||||||
ArtifactServiceMethod.GetSignedArtifactURL,
|
|
||||||
];
|
|
||||||
|
|
||||||
export function createArtifactServiceServer<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(service: ArtifactServiceTwirp<T>) {
|
|
||||||
return new TwirpServer<ArtifactServiceTwirp, T>({
|
|
||||||
service,
|
|
||||||
packageName: "github.actions.results.api.v1",
|
|
||||||
serviceName: "ArtifactService",
|
|
||||||
methodList: ArtifactServiceMethodList,
|
|
||||||
matchRoute: matchArtifactServiceRoute,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function matchArtifactServiceRoute<T extends TwirpContext = TwirpContext>(
|
|
||||||
method: string,
|
|
||||||
events: RouterEvents<T>
|
|
||||||
) {
|
|
||||||
switch (method) {
|
|
||||||
case "CreateArtifact":
|
|
||||||
return async (
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
CreateArtifactRequest,
|
|
||||||
CreateArtifactResponse
|
|
||||||
>[]
|
|
||||||
) => {
|
|
||||||
ctx = { ...ctx, methodName: "CreateArtifact" };
|
|
||||||
await events.onMatch(ctx);
|
|
||||||
return handleArtifactServiceCreateArtifactRequest(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
};
|
|
||||||
case "FinalizeArtifact":
|
|
||||||
return async (
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
FinalizeArtifactRequest,
|
|
||||||
FinalizeArtifactResponse
|
|
||||||
>[]
|
|
||||||
) => {
|
|
||||||
ctx = { ...ctx, methodName: "FinalizeArtifact" };
|
|
||||||
await events.onMatch(ctx);
|
|
||||||
return handleArtifactServiceFinalizeArtifactRequest(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
};
|
|
||||||
case "ListArtifacts":
|
|
||||||
return async (
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
ListArtifactsRequest,
|
|
||||||
ListArtifactsResponse
|
|
||||||
>[]
|
|
||||||
) => {
|
|
||||||
ctx = { ...ctx, methodName: "ListArtifacts" };
|
|
||||||
await events.onMatch(ctx);
|
|
||||||
return handleArtifactServiceListArtifactsRequest(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
};
|
|
||||||
case "GetSignedArtifactURL":
|
|
||||||
return async (
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
GetSignedArtifactURLRequest,
|
|
||||||
GetSignedArtifactURLResponse
|
|
||||||
>[]
|
|
||||||
) => {
|
|
||||||
ctx = { ...ctx, methodName: "GetSignedArtifactURL" };
|
|
||||||
await events.onMatch(ctx);
|
|
||||||
return handleArtifactServiceGetSignedArtifactURLRequest(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
};
|
|
||||||
default:
|
|
||||||
events.onNotFound();
|
|
||||||
const msg = `no handler found`;
|
|
||||||
throw new TwirpError(TwirpErrorCode.BadRoute, msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleArtifactServiceCreateArtifactRequest<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<T, CreateArtifactRequest, CreateArtifactResponse>[]
|
|
||||||
): Promise<string | Uint8Array> {
|
|
||||||
switch (ctx.contentType) {
|
|
||||||
case TwirpContentType.JSON:
|
|
||||||
return handleArtifactServiceCreateArtifactJSON<T>(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
case TwirpContentType.Protobuf:
|
|
||||||
return handleArtifactServiceCreateArtifactProtobuf<T>(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
default:
|
|
||||||
const msg = "unexpected Content-Type";
|
|
||||||
throw new TwirpError(TwirpErrorCode.BadRoute, msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleArtifactServiceFinalizeArtifactRequest<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
FinalizeArtifactRequest,
|
|
||||||
FinalizeArtifactResponse
|
|
||||||
>[]
|
|
||||||
): Promise<string | Uint8Array> {
|
|
||||||
switch (ctx.contentType) {
|
|
||||||
case TwirpContentType.JSON:
|
|
||||||
return handleArtifactServiceFinalizeArtifactJSON<T>(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
case TwirpContentType.Protobuf:
|
|
||||||
return handleArtifactServiceFinalizeArtifactProtobuf<T>(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
default:
|
|
||||||
const msg = "unexpected Content-Type";
|
|
||||||
throw new TwirpError(TwirpErrorCode.BadRoute, msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleArtifactServiceListArtifactsRequest<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<T, ListArtifactsRequest, ListArtifactsResponse>[]
|
|
||||||
): Promise<string | Uint8Array> {
|
|
||||||
switch (ctx.contentType) {
|
|
||||||
case TwirpContentType.JSON:
|
|
||||||
return handleArtifactServiceListArtifactsJSON<T>(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
case TwirpContentType.Protobuf:
|
|
||||||
return handleArtifactServiceListArtifactsProtobuf<T>(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
default:
|
|
||||||
const msg = "unexpected Content-Type";
|
|
||||||
throw new TwirpError(TwirpErrorCode.BadRoute, msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleArtifactServiceGetSignedArtifactURLRequest<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
GetSignedArtifactURLRequest,
|
|
||||||
GetSignedArtifactURLResponse
|
|
||||||
>[]
|
|
||||||
): Promise<string | Uint8Array> {
|
|
||||||
switch (ctx.contentType) {
|
|
||||||
case TwirpContentType.JSON:
|
|
||||||
return handleArtifactServiceGetSignedArtifactURLJSON<T>(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
case TwirpContentType.Protobuf:
|
|
||||||
return handleArtifactServiceGetSignedArtifactURLProtobuf<T>(
|
|
||||||
ctx,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
interceptors
|
|
||||||
);
|
|
||||||
default:
|
|
||||||
const msg = "unexpected Content-Type";
|
|
||||||
throw new TwirpError(TwirpErrorCode.BadRoute, msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async function handleArtifactServiceCreateArtifactJSON<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<T, CreateArtifactRequest, CreateArtifactResponse>[]
|
|
||||||
) {
|
|
||||||
let request: CreateArtifactRequest;
|
|
||||||
let response: CreateArtifactResponse;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const body = JSON.parse(data.toString() || "{}");
|
|
||||||
request = CreateArtifactRequest.fromJson(body, {
|
|
||||||
ignoreUnknownFields: true,
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
const msg = "the json request could not be decoded";
|
|
||||||
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interceptors && interceptors.length > 0) {
|
|
||||||
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
|
||||||
T,
|
|
||||||
CreateArtifactRequest,
|
|
||||||
CreateArtifactResponse
|
|
||||||
>;
|
|
||||||
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
|
||||||
return service.CreateArtifact(ctx, inputReq);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
response = await service.CreateArtifact(ctx, request!);
|
|
||||||
}
|
|
||||||
|
|
||||||
return JSON.stringify(
|
|
||||||
CreateArtifactResponse.toJson(response, {
|
|
||||||
useProtoFieldName: true,
|
|
||||||
emitDefaultValues: false,
|
|
||||||
}) as string
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleArtifactServiceFinalizeArtifactJSON<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
FinalizeArtifactRequest,
|
|
||||||
FinalizeArtifactResponse
|
|
||||||
>[]
|
|
||||||
) {
|
|
||||||
let request: FinalizeArtifactRequest;
|
|
||||||
let response: FinalizeArtifactResponse;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const body = JSON.parse(data.toString() || "{}");
|
|
||||||
request = FinalizeArtifactRequest.fromJson(body, {
|
|
||||||
ignoreUnknownFields: true,
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
const msg = "the json request could not be decoded";
|
|
||||||
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interceptors && interceptors.length > 0) {
|
|
||||||
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
|
||||||
T,
|
|
||||||
FinalizeArtifactRequest,
|
|
||||||
FinalizeArtifactResponse
|
|
||||||
>;
|
|
||||||
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
|
||||||
return service.FinalizeArtifact(ctx, inputReq);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
response = await service.FinalizeArtifact(ctx, request!);
|
|
||||||
}
|
|
||||||
|
|
||||||
return JSON.stringify(
|
|
||||||
FinalizeArtifactResponse.toJson(response, {
|
|
||||||
useProtoFieldName: true,
|
|
||||||
emitDefaultValues: false,
|
|
||||||
}) as string
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleArtifactServiceListArtifactsJSON<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<T, ListArtifactsRequest, ListArtifactsResponse>[]
|
|
||||||
) {
|
|
||||||
let request: ListArtifactsRequest;
|
|
||||||
let response: ListArtifactsResponse;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const body = JSON.parse(data.toString() || "{}");
|
|
||||||
request = ListArtifactsRequest.fromJson(body, {
|
|
||||||
ignoreUnknownFields: true,
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
const msg = "the json request could not be decoded";
|
|
||||||
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interceptors && interceptors.length > 0) {
|
|
||||||
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
|
||||||
T,
|
|
||||||
ListArtifactsRequest,
|
|
||||||
ListArtifactsResponse
|
|
||||||
>;
|
|
||||||
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
|
||||||
return service.ListArtifacts(ctx, inputReq);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
response = await service.ListArtifacts(ctx, request!);
|
|
||||||
}
|
|
||||||
|
|
||||||
return JSON.stringify(
|
|
||||||
ListArtifactsResponse.toJson(response, {
|
|
||||||
useProtoFieldName: true,
|
|
||||||
emitDefaultValues: false,
|
|
||||||
}) as string
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleArtifactServiceGetSignedArtifactURLJSON<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
GetSignedArtifactURLRequest,
|
|
||||||
GetSignedArtifactURLResponse
|
|
||||||
>[]
|
|
||||||
) {
|
|
||||||
let request: GetSignedArtifactURLRequest;
|
|
||||||
let response: GetSignedArtifactURLResponse;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const body = JSON.parse(data.toString() || "{}");
|
|
||||||
request = GetSignedArtifactURLRequest.fromJson(body, {
|
|
||||||
ignoreUnknownFields: true,
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
const msg = "the json request could not be decoded";
|
|
||||||
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interceptors && interceptors.length > 0) {
|
|
||||||
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
|
||||||
T,
|
|
||||||
GetSignedArtifactURLRequest,
|
|
||||||
GetSignedArtifactURLResponse
|
|
||||||
>;
|
|
||||||
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
|
||||||
return service.GetSignedArtifactURL(ctx, inputReq);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
response = await service.GetSignedArtifactURL(ctx, request!);
|
|
||||||
}
|
|
||||||
|
|
||||||
return JSON.stringify(
|
|
||||||
GetSignedArtifactURLResponse.toJson(response, {
|
|
||||||
useProtoFieldName: true,
|
|
||||||
emitDefaultValues: false,
|
|
||||||
}) as string
|
|
||||||
);
|
|
||||||
}
|
|
||||||
async function handleArtifactServiceCreateArtifactProtobuf<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<T, CreateArtifactRequest, CreateArtifactResponse>[]
|
|
||||||
) {
|
|
||||||
let request: CreateArtifactRequest;
|
|
||||||
let response: CreateArtifactResponse;
|
|
||||||
|
|
||||||
try {
|
|
||||||
request = CreateArtifactRequest.fromBinary(data);
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
const msg = "the protobuf request could not be decoded";
|
|
||||||
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interceptors && interceptors.length > 0) {
|
|
||||||
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
|
||||||
T,
|
|
||||||
CreateArtifactRequest,
|
|
||||||
CreateArtifactResponse
|
|
||||||
>;
|
|
||||||
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
|
||||||
return service.CreateArtifact(ctx, inputReq);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
response = await service.CreateArtifact(ctx, request!);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Buffer.from(CreateArtifactResponse.toBinary(response));
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleArtifactServiceFinalizeArtifactProtobuf<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
FinalizeArtifactRequest,
|
|
||||||
FinalizeArtifactResponse
|
|
||||||
>[]
|
|
||||||
) {
|
|
||||||
let request: FinalizeArtifactRequest;
|
|
||||||
let response: FinalizeArtifactResponse;
|
|
||||||
|
|
||||||
try {
|
|
||||||
request = FinalizeArtifactRequest.fromBinary(data);
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
const msg = "the protobuf request could not be decoded";
|
|
||||||
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interceptors && interceptors.length > 0) {
|
|
||||||
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
|
||||||
T,
|
|
||||||
FinalizeArtifactRequest,
|
|
||||||
FinalizeArtifactResponse
|
|
||||||
>;
|
|
||||||
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
|
||||||
return service.FinalizeArtifact(ctx, inputReq);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
response = await service.FinalizeArtifact(ctx, request!);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Buffer.from(FinalizeArtifactResponse.toBinary(response));
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleArtifactServiceListArtifactsProtobuf<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<T, ListArtifactsRequest, ListArtifactsResponse>[]
|
|
||||||
) {
|
|
||||||
let request: ListArtifactsRequest;
|
|
||||||
let response: ListArtifactsResponse;
|
|
||||||
|
|
||||||
try {
|
|
||||||
request = ListArtifactsRequest.fromBinary(data);
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
const msg = "the protobuf request could not be decoded";
|
|
||||||
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interceptors && interceptors.length > 0) {
|
|
||||||
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
|
||||||
T,
|
|
||||||
ListArtifactsRequest,
|
|
||||||
ListArtifactsResponse
|
|
||||||
>;
|
|
||||||
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
|
||||||
return service.ListArtifacts(ctx, inputReq);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
response = await service.ListArtifacts(ctx, request!);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Buffer.from(ListArtifactsResponse.toBinary(response));
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleArtifactServiceGetSignedArtifactURLProtobuf<
|
|
||||||
T extends TwirpContext = TwirpContext
|
|
||||||
>(
|
|
||||||
ctx: T,
|
|
||||||
service: ArtifactServiceTwirp,
|
|
||||||
data: Buffer,
|
|
||||||
interceptors?: Interceptor<
|
|
||||||
T,
|
|
||||||
GetSignedArtifactURLRequest,
|
|
||||||
GetSignedArtifactURLResponse
|
|
||||||
>[]
|
|
||||||