#4282·semaphore

Problem: Bash and Python task template file picker only shows YAML/Ansible files

Author: omaraoukCreated Sep 25, 2026Updated Sep 25, 2026

Issue

When creating a Bash Script or Python Script task template, the Script Filename selector does not show .sh or .py files that exist in the selected Git repository.

Instead, the file picker appears to return/filter for Ansible YAML files.

For example, when creating a Python Script template and selecting the repository, the Script Filename dropdown only contains files such as:

playbooks/connectivity.yml
playbooks/rpmirror.yml
tasks/cleanup.yml
tasks/main.yml
tasks/migrate.yml
tasks/publish.yml
tasks/sync.yml
...

Python .py files that exist in the same repository are not displayed.

The same behavior occurs when creating a Bash Script template: .sh files are not available for selection.

Browser developer tools show that the UI requests the repository's playbooks?branch= endpoint to populate the Script Filename selector. The response contains only YAML/playbook files.

Steps to reproduce

  1. Add a Git repository containing Ansible YAML files as well as .py and/or .sh scripts.
  2. Create a new Task Template.
  3. Select Python Script or Bash Script as the application type.
  4. Select the Git repository.
  5. Open or refresh Script Filename.
  6. Observe that YAML/Ansible files are listed while the appropriate .py or .sh files are missing.

Expected behavior

For a Python Script template, the Script Filename picker should allow selection of Python scripts from the repository.

For a Bash Script template, the picker should allow selection of shell scripts from the repository.

Actual behavior

The Script Filename picker only exposes YAML/Ansible files, making it impossible to create Bash or Python task templates using scripts stored in the repository through the WebUI.

Impact

Web-Frontend (what users interact with)

Installation method

Docker

Database

Postgres

Browser

Chrome

Semaphore Version

semaphoreui/semaphore:v2.19.12

Ansible Version

N/A - the issue occurs during repository file discovery while creating Python Script / Bash Script task templates, before any Ansible task is executed.

Logs & errors

No service-side execution error is required to reproduce the issue.

When creating either a Python Script or Bash Script Task Template, the WebUI's Script Filename picker does not display .py or .sh files that exist in the selected Git repository.

The UI validation message also refers to the field as a playbook:

Playbook filename is required

Using browser DevTools, clicking the refresh button for Script Filename causes the WebUI to request the repository's:

playbooks?branch=

endpoint.

The HTTP request succeeds with 200, but the backend response contains only YAML files:

json
[
  "playbooks/connectivity.yml",
  "playbooks/rpmirror.yml",
  "tasks/cleanup.yml",
  "tasks/cleanup_workflow.yml",
  "tasks/lifecycle_lock.yml",
  "tasks/main.yml",
  "tasks/migrate.yml",
  "tasks/migrate_workflow.yml",
  "tasks/publish.yml",
  "tasks/publish_workflow.yml",
  "tasks/rollback.yml",
  "tasks/rollback_workflow.yml",
  "tasks/snapshot_id.yml",
  "tasks/sync.yml",
  "tasks/sync_workflow.yml",
  "tasks/validate.yml",
  "tasks/validate_workflow.yml"
]

The same repository and branch contain Python files, but those files are absent from the response.

Manual installation - system information

Semaphore is running using Docker rather than a manual binary/package installation.

Host information:

5.14.0-687.45.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Sep 8 14:17:55 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux

Reverse proxy:

nginx/1.20.1

Configuration

Semaphore deployment:

  • Version: v2.19.12
  • Docker image: semaphoreui/semaphore:v2.19.12
  • Python Script application: enabled
  • Bash Script application: enabled

Project configuration:

  • Project ID: 1
  • Repository ID: 1
  • Repository name: rpmirror
  • Branch: main
  • Repository type: Git
  • Repository authentication: SSH key

The repository contains Python files on main, including:

scripts/trigger_workflow.py
tests/test_trigger_workflow.py

The files were verified directly against origin/main.

For example:

bash
git ls-tree -r origin/main --name-only | grep trigger_workflow

returns:

scripts/trigger_workflow.py
tests/test_trigger_workflow.py

A temporary Python file was also placed at the repository root to determine whether the problem was caused by the scripts/ directory. The root-level .py file was also absent from the Script Filename picker.

Additional information

REST API workaround

The Task Template API accepts the Python script even though the WebUI's Script Filename picker does not expose it.

For example, the Python template was created directly through the REST API using:

json
{
  "project_id": 1,
  "inventory_id": 1,
  "repository_id": 1,
  "environment_ids": [],
  "environment_id": 0,
  "name": "RPM Mirror - Trigger Nightly Sync & Cleanup",
  "playbook": "scripts/trigger_workflow.py",
  "arguments": "[]",
  "app": "python",
  "task_params": {},
  "jwt_params": {}
}

Semaphore successfully created the template:

json
{
  "id": 17,
  "project_id": 1,
  "inventory_id": 1,
  "repository_id": 1,
  "environment_ids": [],
  "environment_id": 0,
  "name": "RPM Mirror - Trigger Nightly Sync & Cleanup",
  "playbook": "scripts/trigger_workflow.py",
  "arguments": "[]",
  "app": "python",
  "tasks": 0,
  "jwt_params": {}
}

After creation through the REST API, the WebUI correctly displays:

Application: Python Script
Script Filename: scripts/trigger_workflow.py

The Python Task Template also executes successfully.

For example, the Python template successfully made an API request that started a Semaphore Workflow:

Semaphore workflow trigger accepted: HTTP 201
Project ID: 1
Workflow ID: 1
Id: 1
Project Id: 1
Status: running

The triggered workflow subsequently completed successfully.

This demonstrates that:

  1. Python Script execution is functional.
  2. Git checkout of the repository is functional.
  3. The .py path is accepted by the Task Template API.
  4. The WebUI correctly displays the .py path after the template is created through the API.
  5. The problem appears isolated to repository file discovery / the Script Filename picker.

Browser inspection shows that the Python/Bash Script Filename control uses the repository:

playbooks?branch=

request.

That endpoint returns the repository's .yml files but does not return .py files.

The same Script Filename component and playbooks?branch= request are used when creating a Bash Script template.

The UI also displays:

Playbook filename is required

for the Script Filename field, which may indicate that the Bash/Python selector is reusing playbook-specific file discovery or validation.

Expected

For a Python Script Task Template, the Script Filename picker should include repository Python files, for example:

scripts/trigger_workflow.py

For a Bash Script Task Template, the picker should similarly expose supported shell scripts.

Actual

Only playbook/YAML files are returned by the repository file-discovery request, making it impossible to create the Python/Bash Script template through the WebUI.

Creating the template directly through the REST API is currently a working workaround.