Custom Scripts
Extend Warp with custom automation scripts.
Custom Scripts let you define automation scripts in your Migration HQ repository and execute them directly from issue comments using the /run slash command. Use them to automate repetitive tasks, integrate with external systems, or extend your migration workflows.
How it works:
Write a script and place it in the
bin/directory of your Migration HQ repositoryRegister the script in your
warp.ymlconfiguration fileExecute it from any backlog entry issue with
/run <script_id>
Warp supports Bash, PowerShell, Ruby, and Python scripts.
Prerequisites
Before using Custom Scripts, ensure you have:
Admin access to your Migration HQ repository
Scripts stored in the
bin/directory at the root of Migration HQScripts marked as executable (
chmod +x bin/your_script.sh)A valid
warp.ymlconfiguration in theconfig/directory
Configuration
Define scripts in your warp.yml file under the scripts: key. Each script entry uses a unique identifier as its key.
Required Fields
name
String
Human-friendly name displayed in responses and help messages
description
String
Brief explanation of what the script does
language
String
Script language: bash, pwsh, python, or ruby
filename
String
Name of the script file in the bin/ directory
Optional Fields
allow_vault
Boolean
When true, injects PKFS_MASTER_KEY into the script's environment
Basic Example
With the corresponding script at bin/notify_team.sh:
Execute it from an issue comment:
Script Arguments
Scripts can accept named arguments that are validated by Warp before execution.
Defining Arguments
Add an arguments block to your script configuration. Each argument has a description (required) and an optional required flag.
Arguments without required: true are optional.
Passing Arguments at Runtime
Use the --script_args flag followed by space-separated key=value pairs:
Boolean flags are also supported — they set the argument value to "true":
Warp validates arguments before executing your script. Missing required arguments or unrecognized argument names will produce an error message — your script will not run.
How Arguments Are Delivered
Arguments are passed to your script as environment variables with the prefix WARP_SCRIPT_ARGS__, followed by the argument name converted to uppercase with non-alphanumeric characters replaced by underscores.
Examples:
wiki_page
WARP_SCRIPT_ARGS__WIKI_PAGE
tenant-id
WARP_SCRIPT_ARGS__TENANT_ID
db.url
WARP_SCRIPT_ARGS__DB_URL
Environment Variables
Warp injects the following environment variables into every script execution:
WARP_SCRIPT_ID
The script's identifier from warp.yml
Yes
WARP_SCRIPT_NAME
The script's human-friendly name
Yes
WARP_SCRIPT_DESCRIPTION
The script's description
Yes
WARP_SCRIPT_ARGS__<NAME>
Value for each provided argument
Yes (one per argument)
WARP_PROJECT_ID
The Warp project ID
Yes
WARP_BACKLOG_ENTRY_ID
The backlog entry (issue) ID
Yes
WARP_BACKLOG_ENTRY_DESTINATION
The target repository name
Yes
WARP_BACKLOG_ENTRY_SOURCE
The source repository name
Yes
PKFS_MASTER_KEY
The Vault master key for decrypting credentials
Only when allow_vault: true
Vault Integration
When allow_vault is set to true, Warp injects the PKFS_MASTER_KEY environment variable into your script's execution environment. This allows your script to decrypt and query credentials stored in your Warp Vault.
Your script can then use the Warp CLI to query vault credentials:
Enabling allow_vault gives the script access to all credentials in your Vault. Only enable this for scripts that require credential access.
For details on the Vault query syntax, see Using Credentials in Scripts.
Script Examples by Language
Bash
PowerShell
Ruby
Python
Access Control
Script execution can be restricted using policies in your warp.yml. Define a policies.scripts block to control who can run each script.
When a script policy is defined, only the listed users and teams can execute that script. Users not on the list will see an error message listing who is authorized.
When no script policies are defined, all organization members can run all scripts.
Execution
Custom scripts run on a GitHub Actions runner agent within your Migration HQ repository. When a script completes, Warp automatically posts a comment on the issue:
On success: A confirmation message with a link to the workflow run
On failure: An error message with the exit code and a link to the workflow run logs
You can view detailed logs by navigating to the Actions tab of your Migration HQ repository and selecting the workflow run. For more information on viewing runner logs, see Runner Agent.
Running a Script
To execute a custom script, post a comment on a backlog entry issue using the /run slash command:
See the /run command reference for full usage details.
Best Practices
Add shebang lines — Always include
#!/bin/bash,#!/usr/bin/env ruby, etc. at the top of your scriptsMake scripts executable — Run
chmod +x bin/your_script.shbefore committingValidate inputs — Check for required data and provide helpful error messages
Use descriptive names — Choose clear script identifiers and file names
Document arguments — Write clear descriptions for each argument in
warp.ymlHandle errors gracefully — Use proper exit codes (
set -ein Bash) and error handlingTest locally first — Verify scripts work before adding them to
warp.ymlKeep scripts focused — Each script should do one thing well
Troubleshooting
Script not found
Verify the filename in warp.yml matches the actual file in bin/
Permission denied
Make the script executable: chmod +x bin/your_script.sh and commit
Arguments not working
Use --script_args key=value format. Check that argument names match the arguments block in warp.yml
Script fails silently
Add error handling and logging to your script. Use set -e in Bash scripts
Unauthorized
Check policies.scripts in warp.yml and verify your username or team membership
Script not available
Ensure warp.yml has been committed and pushed to your Migration HQ's default branch
Last updated
Was this helpful?