This commit is contained in:
+13
-10
@@ -1,23 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DOCKERHUB_PASSWORD=${1}
|
DOCKER_PASSWORD="${1}"
|
||||||
GITEA_API_KEY=${2}
|
GITEA_API_KEY="${2}"
|
||||||
username=pizza2d1
|
docker_username=pizza2da1
|
||||||
|
gitea_username=pizza2d1
|
||||||
repo_name=better_ripper
|
repo_name=better_ripper
|
||||||
|
|
||||||
TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/auth/token" \
|
TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/auth/token" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"identifier": "${username}", "secret": "${DOCKERHUB_PASSWORD}"}' \
|
-d "{\"identifier\": \"${docker_username}\", \"secret\": \"${DOCKER_PASSWORD}\"}" \
|
||||||
| jq -r .access_token)
|
| jq -r .access_token)
|
||||||
|
|
||||||
|
echo $TOKEN
|
||||||
|
|
||||||
curl -X 'PUT' \
|
curl -X 'PUT' \
|
||||||
'https://gitea.happylizard.me/api/v1/repos/${username}/${repo_name}/actions/secrets/DOCKERHUB_TOKEN' \
|
"https://gitea.happylizard.me/api/v1/repos/${gitea_username}/${repo_name}/actions/secrets/DOCKERHUB_TOKEN" \
|
||||||
-H 'accept: application/json' \
|
-H 'accept: application/json' \
|
||||||
-H 'Authorization: token ${GITEA_API_KEY}' \
|
-H "Authorization: token ${GITEA_API_KEY}" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d '{
|
-d "{
|
||||||
"data": "${TOKEN}",
|
\"data\": \"${TOKEN}\",
|
||||||
"description": ""
|
\"description\": \"\"
|
||||||
}'
|
}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user