diff --git a/action.yml b/action.yml index df81bfd..9fbb8b2 100644 --- a/action.yml +++ b/action.yml @@ -10,8 +10,10 @@ inputs: description: The api token in niks3 required: true pin: - description: The name of the pin - required: true + description: > + 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 @@ -29,13 +31,19 @@ runs: NIKS3_REPO_NAME=$(echo "$FORGEJO_REPOSITORY" | sed 's/[^[:alnum:]_-]/./g') echo "NIKS3_AUTH_TOKEN_FILE=$NIKS3_AUTH_TOKEN_FILE" >> "$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: NIKS3_SERVER_URL: ${{ inputs.server-url }} TOKEN: ${{ inputs.token }} - - name: upload artifact - if: inputs.pin != '' - run: niks3 push --pin "$NAME" "$(realpath result)" + - name: upload artifact with custom name + if: inputs.pin != 'false' + 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: - NAME: ${{ inputs.pin }} - + PIN: ${{ inputs.pin }}