Skip to content

Commit

Permalink
more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyclenerd committed Dec 25, 2024
1 parent 0cd5c20 commit dca893b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ if [[ "$MY_MODE" == "delete" ]]; then
exit_with_failure "Failed to get ID of the Hetzner Cloud Server!"
fi

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

echo "List self-hosted runners for repository..."
# List self-hosted runners for repository
# https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
echo "List self-hosted runners..."
curl -L \
--fail-with-body \
-o "github-runners.json" \
Expand All @@ -245,7 +249,9 @@ if [[ "$MY_MODE" == "delete" ]]; then
exit_with_failure "Failed to get ID of the GitHub Actions Runner!"
fi

echo "Delete GitHub Actions Runner from repository..."
# Delete a self-hosted runner from repository
# https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
echo "Delete GitHub Actions Runner..."
curl -L \
-X DELETE \
--fail-with-body \
Expand All @@ -269,7 +275,7 @@ fi

# Create GitHub Actions registration token for registering a self-hosted runner to a repository
# https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository
echo "Create GitHub Actions Runner registration token for GitHub repository..."
echo "Create GitHub Actions Runner registration token..."
curl -L \
-X "POST" \
--fail-with-body \
Expand Down Expand Up @@ -356,6 +362,7 @@ if [[ "$MY_NETWORK" != "null" ]]; then
fi

# Send a POST request to the Hetzner Cloud API to create a server.
# https://docs.hetzner.cloud/#servers-create-a-server
echo "Create server..."
if ! curl \
-X POST \
Expand Down Expand Up @@ -391,6 +398,7 @@ RETRY_COUNT=0
echo "Wait for server..."
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
# Download and parse server status
# https://docs.hetzner.cloud/#servers-get-a-server
curl -s \
-o "servers.json" \
-H "Content-Type: application/json" \
Expand Down Expand Up @@ -420,6 +428,8 @@ MAX_RETRIES=$MY_RUNNER_WAIT
RETRY_COUNT=0
echo "Wait for GitHub Actions Runner registration..."
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
# List self-hosted runners for repository
# https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
curl -L -s \
-o "github-runners.json" \
-H "Accept: application/vnd.github+json" \
Expand Down

0 comments on commit dca893b

Please sign in to comment.