This commit is contained in:
@@ -13,6 +13,8 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- run: ./update_dockerhub_api ${{ secrets.DOCKERHUB_PASSWORD }} ${{ secrets.GITEA_API_KEY }}
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DOCKERHUB_PASSWORD=${1}
|
||||||
|
GITEA_API_KEY=${2}
|
||||||
|
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": "${username}", "secret": "${DOCKERHUB_PASSWORD}"}' \
|
||||||
|
| jq -r .access_token)
|
||||||
|
|
||||||
|
curl -X 'PUT' \
|
||||||
|
'https://gitea.happylizard.me/api/v1/repos/${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": ""
|
||||||
|
}'
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user