differentiate between auth user and package owner
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7386b995cd
commit
0e082a0c20
@ -11,6 +11,7 @@ A small drone plugin to help with uploading packages to gitea.
|
||||
|package|Package name|(mandatory)|
|
||||
|version|Package version, may be a filename|(mandatory)|
|
||||
|user|username for authentication|burble|
|
||||
|owner|owner of package|burble|
|
||||
|url|base URL of gitea|https://git.burble.dn42/api/packages|
|
||||
|filename|filename to upload|artifact name|
|
||||
|
||||
|
@ -14,6 +14,7 @@ fi
|
||||
|
||||
BASE_URL=${PLUGIN_URL:-https://git.burble.dn42/api/packages}
|
||||
USER=${PLUGIN_USER:-burble}
|
||||
OWNER=${PLUGIN_OWNER:-burble}
|
||||
FILENAME=${PLUGIN_FILENAME:-$PLUGIN_ARTIFACT}
|
||||
|
||||
# version or token could be a filename
|
||||
@ -36,7 +37,7 @@ TOKEN=$(maybe_from_file "$PLUGIN_TOKEN")
|
||||
# finally do the curl thing to upload the artifact
|
||||
|
||||
url=$(printf '%s/%s/generic/%s/%s/%s' \
|
||||
"$BASE_URL" "$USER" "$PLUGIN_PACKAGE" \
|
||||
"$BASE_URL" "$OWNER" "$PLUGIN_PACKAGE" \
|
||||
"$VERSION" "$PLUGIN_ARTIFACT")
|
||||
|
||||
curl --user "${USER}:${TOKEN}" --upload-file="$FILENAME" "$url"
|
||||
|
Loading…
x
Reference in New Issue
Block a user