Files
better_ripper/update_dockerhub_api
T
pizza2d1 53020ee522
Build and Push Docker Image / docker (push) Successful in 2m53s
Hopefully works
2026-09-17 12:18:41 -06:00

27 lines
689 B
Bash
Executable File

#!/bin/bash
DOCKER_PASSWORD="${1}"
GITEA_API_KEY="${2}"
docker_username=pizza2da1
gitea_username=pizza2d1
repo_name=better_ripper
TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/auth/token" \
-H "Content-Type: application/json" \
-d "{\"identifier\": \"${docker_username}\", \"secret\": \"${DOCKER_PASSWORD}\"}" \
| jq -r .access_token)
echo $TOKEN
curl -X 'PUT' \
"https://gitea.happylizard.me/api/v1/repos/${gitea_username}/${repo_name}/actions/secrets/DOCKERHUB_TOKEN" \
-H 'accept: application/json' \
-H "Authorization: token ${GITEA_API_KEY}" \
-H 'Content-Type: application/json' \
-d "{
\"data\": \"${TOKEN}\",
\"description\": \"\"
}"