Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ updates:
- /build-docker-image
- /build-expo-app
- /deploy-expo-app
- /import-ansible-galaxy-role
- /setup-eas
- /setup-java
- /setup-turborepo
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Please take a closer look at the detailed instructions for the individual action
- [build-docker-image](build-docker-image/README.md)
- [build-expo-app](build-expo-app/README.md)
- [deploy-expo-app](deploy-expo-app/README.md)
- [import-ansible-galaxy-role](import-ansible-galaxy-role/README.md)
- [setup-eas](setup-eas/README.md)
- [setup-java](setup-java/README.md)
- [setup-turborepo](setup-turborepo/README.md)
Expand Down
30 changes: 30 additions & 0 deletions import-ansible-galaxy-role/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# import-ansible-galaxy-role

> Import Ansible role to Ansible Galaxy

This action provides the following functionality for GitHub Actions users:

* Setup Python
* Install ansible-core
* Import an Ansible role to Ansible Galaxy

## Usage

```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: skriptfabrik/github-actions/import-ansible-galaxy-role@main
with:
api-key: ${{ secrets.GALAXY_API_KEY }}
```

## Inputs

| Name | Required | Default | Description |
| --------------------|----------|----------|--------------------------------------------|
| `api-key` | `true` | `""` | The Ansible Galaxy API key |
| `branch` | `false` | `"main"` | The branch to import |
| `working-directory` | `false` | `"."` | Working directory to run ansible-galaxy in |
37 changes: 37 additions & 0 deletions import-ansible-galaxy-role/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Ansible Galaxy Role Import
description: Import Ansible role to Ansible Galaxy

inputs:
api-key:
description: The Ansible Galaxy API key
required: true

branch:
description: The branch to import
default: main

working-directory:
description: Working directory to run ansible-galaxy in
default: .

runs:
using: composite
steps:
- name: Setup Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: 3.x

- name: Install ansible-core
run: python -m pip install --upgrade ansible-core
shell: bash
Comment thread
schnellert marked this conversation as resolved.

- name: Import role to Ansible Galaxy
run: |
ansible-galaxy role import \
--api-key "${{ inputs.api-key }}" \
--branch "${{ inputs.branch }}" \
"${GITHUB_REPOSITORY%%/*}" \
"${GITHUB_REPOSITORY##*/}"
Comment thread
schnellert marked this conversation as resolved.
Comment thread
Copilot marked this conversation as resolved.
shell: bash
working-directory: "${{ inputs.working-directory }}"