Skip to content

ansible-actions/ansible-galaxy-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Action Ansible Galaxy Roles Release

This Action will import ansible roles on galaxy-ng. Caution, this action is only for roles, for collections maybe you want to consider using the ansible-publish action.

Example usage

Example of .github/workflows/galaxy.yml

---
name: Galaxy-NG Roles Import

# yamllint disable-line rule:truthy
on:
  release:
    types: ['created']

jobs:
  build:
    name: Galaxy Role Importer
    runs-on: ubuntu-latest

    steps:
      - name: 'Checkout git repo'
        uses: actions/checkout@v4
        with:
          submodules: true
          fetch-depth: 0

      - name: 'Release on galaxy'
        uses: ansible-actions/ansible-galaxy-action@v1.2.0
        with:
          galaxy_api_key: ${{ secrets.galaxy_api_key }}

You can define the described variables like this:

[...]
        with:
          galaxy_api_key: ${{ secrets.galaxy_api_key }}
          galaxy_version: '1.2.3'
          path: './'
          galaxy_api: 'https://galaxy.ansible.com/api/'

Variables

name default value description
galaxy_api_key - Your personal Galaxy-NG API Token
path ./ The location of your role. (relative path)
galaxy_api https://galaxy.ansible.com/api/ Ansible Galaxy API
galaxy_version - The galaxy version for galaxy-ng.

Some Hints

  • You find your Galaxy-NG Token on Galaxy-NG -> Collections -> API-Token. The collections token is valid for roles too.
  • You can only import new role releases on ansible-galaxy
  • The galaxy version is provided with the ansible-galaxy role import --branch "$galaxy_version" option on the galaxy import tool. The default value main as branch name.