robertdebock / galaxy-action

Publish Ansible roles to Galaxy
32 stars 5 forks source link

ERROR! Error when finding available api versions from default (https://galaxy.ansible.com) (HTTP Code: 401, Message: Unauthorized) #14

Open juju4 opened 4 days ago

juju4 commented 4 days ago

Trying to import role after new tag is failing with above error. Example https://github.com/juju4/ansible-adduser/actions/runs/11990259755/job/33427569791

Run robertdebock/galaxy-action@1.2.1
/usr/bin/docker run --name robertdebockgithubactiongalaxy_19ef05 --label aa6c0e --workdir /github/workspace --rm -e "INPUT_GALAXY_API_KEY" -e "INPUT_PATH" -e "INPUT_GIT_BRANCH" -e "galaxy_api_key" -e "git_branch" -e "path" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ansible-adduser/ansible-adduser":"/github/workspace" robertdebock/github-action-galaxy
+ cd juju4.adduser
+ echo juju4/ansible-adduser
+ cut -d/ -f1
+ echo juju4/ansible-adduser
+ cut -d/ -f2
+ ansible-galaxy role import --api-key *** --branch main juju4 ansible-adduser
ERROR! Error when finding available api versions from default (https://galaxy.ansible.com/) (HTTP Code: 401, Message: Unauthorized)

It seems syntax has changed and existing environment variable is not supported anymore either --token or --api-key per https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html ansible.cfg per https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#configuring-the-ansible-galaxy-client

none seems to work for me if using previously existing token token must be renew and only "API token" under the collections part in galaxy web UI, no more preferences section and no "API token" under roles with updated token, ansible-galaxy role import --branch main juju4 ansible-adduser is authorized and process (failing a bit after "galaxy_importer.exceptions.LegacyRoleSchemaError: unknown field in galaxy_info: LegacyGalaxyInfo.init() got an unexpected keyword argument 'standalone'". once fixed, manual import ansible-galaxy role import --branch main juju4 ansible-adduser is working)

juju4 commented 4 days ago

sidenote, future of roles seems pretty uncertain even if still working for now. https://www.reddit.com/r/ansible/comments/lnbclr/are_standalone_ansible_roles_a_deadend/