@@ -219,6 +219,8 @@ if [[ "$MY_MODE" == "delete" ]]; then
219
219
exit_with_failure " Failed to get ID of the Hetzner Cloud Server!"
220
220
fi
221
221
222
+ # Send a DELETE request to the Hetzner Cloud API to delete the server.
223
+ # https://docs.hetzner.cloud/#servers-delete-a-server
222
224
echo " Delete server..."
223
225
curl \
224
226
-X DELETE \
@@ -229,7 +231,9 @@ if [[ "$MY_MODE" == "delete" ]]; then
229
231
|| exit_with_failure " Error deleting server!"
230
232
echo " Hetzner Cloud Server deleted successfully."
231
233
232
- echo " List self-hosted runners for repository..."
234
+ # List self-hosted runners for repository
235
+ # https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
236
+ echo " List self-hosted runners..."
233
237
curl -L \
234
238
--fail-with-body \
235
239
-o " github-runners.json" \
@@ -245,7 +249,9 @@ if [[ "$MY_MODE" == "delete" ]]; then
245
249
exit_with_failure " Failed to get ID of the GitHub Actions Runner!"
246
250
fi
247
251
248
- echo " Delete GitHub Actions Runner from repository..."
252
+ # Delete a self-hosted runner from repository
253
+ # https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
254
+ echo " Delete GitHub Actions Runner..."
249
255
curl -L \
250
256
-X DELETE \
251
257
--fail-with-body \
269
275
270
276
# Create GitHub Actions registration token for registering a self-hosted runner to a repository
271
277
# https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository
272
- echo " Create GitHub Actions Runner registration token for GitHub repository ..."
278
+ echo " Create GitHub Actions Runner registration token..."
273
279
curl -L \
274
280
-X " POST" \
275
281
--fail-with-body \
@@ -356,6 +362,7 @@ if [[ "$MY_NETWORK" != "null" ]]; then
356
362
fi
357
363
358
364
# Send a POST request to the Hetzner Cloud API to create a server.
365
+ # https://docs.hetzner.cloud/#servers-create-a-server
359
366
echo " Create server..."
360
367
if ! curl \
361
368
-X POST \
@@ -391,6 +398,7 @@ RETRY_COUNT=0
391
398
echo " Wait for server..."
392
399
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
393
400
# Download and parse server status
401
+ # https://docs.hetzner.cloud/#servers-get-a-server
394
402
curl -s \
395
403
-o " servers.json" \
396
404
-H " Content-Type: application/json" \
@@ -420,6 +428,8 @@ MAX_RETRIES=$MY_RUNNER_WAIT
420
428
RETRY_COUNT=0
421
429
echo " Wait for GitHub Actions Runner registration..."
422
430
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
431
+ # List self-hosted runners for repository
432
+ # https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
423
433
curl -L -s \
424
434
-o " github-runners.json" \
425
435
-H " Accept: application/vnd.github+json" \
0 commit comments