diff --git a/action.yml b/action.yml index d1512bd..b5f6e7c 100644 --- a/action.yml +++ b/action.yml @@ -7,9 +7,17 @@ inputs: galaxy-api-key: required: true description: The key to use to authenticate against ansible-galaxy + repository-owner: + required: true + description: The owner of the repository from which to import the role + repository-name: + required: true + description: The name of the repository from which to import the role runs: using: docker image: Dockerfile env: GALAXY_API_TOKEN: ${{ inputs.galaxy-api-key }} + GALAXY_REPOSITORY_OWNER: ${{ inputs.repository-owner }} + GALAXY_REPOSITORY_NAME: ${{ inputs.repository-name }} diff --git a/entrypoint.sh b/entrypoint.sh index cea82e4..1eb7e60 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,10 +1,7 @@ #! /bin/sh set -e -command_string="ansible-galaxy role import" - -if [ -n "${GALAXY_API_TOKEN}" ]; then - command_string="$command_string --api-key ${GALAXY_API_TOKEN} ${GITHUB_REPOSITORY%/*} ${GITHUB_REPOSITORY#*/}" -fi +ansible_galaxy_command_string="ansible-galaxy role import" +command_string="$ansible_galaxy_command_string --api-key ${GALAXY_API_TOKEN} ${GALAXY_REPOSITORY_OWNER} ${GALAXY_REPOSITORY_NAME}" echo "Command: $command_string" -eval "$command_string" \ No newline at end of file +eval "$command_string"