feat: add option to not upload instantly, but only setup niks3

This commit is contained in:
Tamipes 2026-07-12 02:51:09 +02:00
parent d32d687b61
commit dca9b69b41

View file

@ -18,15 +18,23 @@ inputs:
runs: runs:
using: composite using: composite
steps: steps:
- name: niks3 upload - name: setup authentication
run: | run: |
# echo "url is: $ACTIONS_ID_TOKEN_REQUEST_URL" # echo "url is: $ACTIONS_ID_TOKEN_REQUEST_URL"
# curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://niks3.tami.moe" > /run/niks3-auth-token # curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://niks3.tami.moe" > /run/niks3-auth-token
export NIKS3_AUTH_TOKEN_FILE=$(mktemp) export NIKS3_AUTH_TOKEN_FILE=$(mktemp)
printf '%s' "$TOKEN" > "$NIKS3_AUTH_TOKEN_FILE" printf '%s' "$TOKEN" > "$NIKS3_AUTH_TOKEN_FILE"
niks3 push --pin "$NAME" "$(realpath result)" niks3 push --pin "$NAME" "$(realpath result)"
echo "NIKS3_AUTH_TOKEN_FILE=$NIKS3_AUTH_TOKEN_FILE" >> "$FORGEJO_ENV"
echo "NIKS3_SERVER_URL=$NIKS3_SERVER_URL" >> "$FORGEJO_ENV"
env: env:
NIKS3_SERVER_URL: ${{ inputs.server-url }} NIKS3_SERVER_URL: ${{ inputs.server-url }}
TOKEN: ${{ inputs.token }} TOKEN: ${{ inputs.token }}
- name: upload artifact
if: inputs.pin != ''
run: niks3 push --pin "$NAME" "$(realpath result)"
env:
NAME: ${{ inputs.pin }} NAME: ${{ inputs.pin }}