update authentication logic
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
20c5c389e3
commit
164359e8a8
1 changed files with 9 additions and 6 deletions
|
@ -52,23 +52,26 @@ def main [
|
||||||
|
|
||||||
let auth = (
|
let auth = (
|
||||||
if (
|
if (
|
||||||
(not ($env | get -i GITHUB_ACTOR | is-empty))
|
(not ($env | get -i USERNAME | is-empty))
|
||||||
and
|
and
|
||||||
(not ($env | get -i GITHUB_TOKEN | is-empty))
|
(not ($env | get -i PASSWORD | is-empty))
|
||||||
) {
|
) {
|
||||||
{username: $env.GITHUB_ACTOR, password: $env.GITHUB_TOKEN}
|
{username: $env.USERNAME, password: $env.PASSWORD}
|
||||||
|
print "Got username and password from USERNAME and PASSWORD"
|
||||||
} else if (
|
} else if (
|
||||||
(not ($env | get -i PLUGIN_USERNAME | is-empty))
|
(not ($env | get -i PLUGIN_USERNAME | is-empty))
|
||||||
and
|
and
|
||||||
(not ($env | get -i PLUGIN_PASSWORD | is-empty))
|
(not ($env | get -i PLUGIN_PASSWORD | is-empty))
|
||||||
) {
|
) {
|
||||||
{username: $env.PLUGIN_USERNAME, password: $env.PLUGIN_PASSWORD}
|
{username: $env.PLUGIN_USERNAME, password: $env.PLUGIN_PASSWORD}
|
||||||
|
print "Got username and password from PLUGIN_USERNAME and PLUGIN_PASSWORD"
|
||||||
} else if (
|
} else if (
|
||||||
(not ($env | get -i USERNAME | is-empty))
|
(not ($env | get -i GITHUB_ACTOR | is-empty))
|
||||||
and
|
and
|
||||||
(not ($env | get -i PASSWORD | is-empty))
|
(not ($env | get -i GITHUB_TOKEN | is-empty))
|
||||||
) {
|
) {
|
||||||
{username: $env.USERNAME, password: $env.PASSWORD}
|
{username: $env.GITHUB_ACTOR, password: $env.GITHUB_TOKEN}
|
||||||
|
print "Got username and password from GITHUB_ACTOR and GITHUB_TOKEN"
|
||||||
} else {
|
} else {
|
||||||
print "Unable to determine authentication parameters!"
|
print "Unable to determine authentication parameters!"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue