feat: update pin input usage, and pinning name behaviour

This commit is contained in:
Tamipes 2026-07-13 20:29:52 +02:00
parent 6d9f6007cf
commit 335087faaf

View file

@ -10,8 +10,10 @@ inputs:
description: The api token in niks3 description: The api token in niks3
required: true required: true
pin: pin:
description: The name of the pin description: >
required: true Whether to pin $(readlink result), if true then uses default name, if a string it uses that name
default: "false"
required: false
# enable-openid-connect: true # enable-openid-connect: true
@ -29,13 +31,19 @@ runs:
NIKS3_REPO_NAME=$(echo "$FORGEJO_REPOSITORY" | sed 's/[^[:alnum:]_-]/./g') NIKS3_REPO_NAME=$(echo "$FORGEJO_REPOSITORY" | sed 's/[^[:alnum:]_-]/./g')
echo "NIKS3_AUTH_TOKEN_FILE=$NIKS3_AUTH_TOKEN_FILE" >> "$FORGEJO_ENV" echo "NIKS3_AUTH_TOKEN_FILE=$NIKS3_AUTH_TOKEN_FILE" >> "$FORGEJO_ENV"
echo "NIKS3_SERVER_URL=$NIKS3_SERVER_URL" >> "$FORGEJO_ENV" echo "NIKS3_SERVER_URL=$NIKS3_SERVER_URL" >> "$FORGEJO_ENV"
echo "NIKS3_REPO_NAME=$NIKS3_REPO_NAME" >> "$FORGEJO_ENV" echo "NIKS3_REPO_NAME=CI.$NIKS3_REPO_NAME" >> "$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 - name: upload artifact with custom name
if: inputs.pin != '' if: inputs.pin != 'false'
run: niks3 push --pin "$NAME" "$(realpath result)" run: |
if [ "$PIN" = "true" ]; then
echo "pinning with default name"
niks3 push --pin "$NIKS3_REPO_NAME" "$(realpath result)"
else
echo "pinning with default name plus pin string"
niks3 push --pin "$NIKS3_REPO_NAME.$PIN" "$(realpath result)"
fi
env: env:
NAME: ${{ inputs.pin }} PIN: ${{ inputs.pin }}