Skip to content

Commit dca893b

Browse files
committed
more comments
1 parent 0cd5c20 commit dca893b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

action.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ if [[ "$MY_MODE" == "delete" ]]; then
219219
exit_with_failure "Failed to get ID of the Hetzner Cloud Server!"
220220
fi
221221

222+
# Send a DELETE request to the Hetzner Cloud API to delete the server.
223+
# https://docs.hetzner.cloud/#servers-delete-a-server
222224
echo "Delete server..."
223225
curl \
224226
-X DELETE \
@@ -229,7 +231,9 @@ if [[ "$MY_MODE" == "delete" ]]; then
229231
|| exit_with_failure "Error deleting server!"
230232
echo "Hetzner Cloud Server deleted successfully."
231233

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..."
233237
curl -L \
234238
--fail-with-body \
235239
-o "github-runners.json" \
@@ -245,7 +249,9 @@ if [[ "$MY_MODE" == "delete" ]]; then
245249
exit_with_failure "Failed to get ID of the GitHub Actions Runner!"
246250
fi
247251

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..."
249255
curl -L \
250256
-X DELETE \
251257
--fail-with-body \
@@ -269,7 +275,7 @@ fi
269275

270276
# Create GitHub Actions registration token for registering a self-hosted runner to a repository
271277
# 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..."
273279
curl -L \
274280
-X "POST" \
275281
--fail-with-body \
@@ -356,6 +362,7 @@ if [[ "$MY_NETWORK" != "null" ]]; then
356362
fi
357363

358364
# Send a POST request to the Hetzner Cloud API to create a server.
365+
# https://docs.hetzner.cloud/#servers-create-a-server
359366
echo "Create server..."
360367
if ! curl \
361368
-X POST \
@@ -391,6 +398,7 @@ RETRY_COUNT=0
391398
echo "Wait for server..."
392399
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
393400
# Download and parse server status
401+
# https://docs.hetzner.cloud/#servers-get-a-server
394402
curl -s \
395403
-o "servers.json" \
396404
-H "Content-Type: application/json" \
@@ -420,6 +428,8 @@ MAX_RETRIES=$MY_RUNNER_WAIT
420428
RETRY_COUNT=0
421429
echo "Wait for GitHub Actions Runner registration..."
422430
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
423433
curl -L -s \
424434
-o "github-runners.json" \
425435
-H "Accept: application/vnd.github+json" \

0 commit comments

Comments
 (0)