This document provides guidance for AI agents and automated systems that interact with the Deploy Course to qBraid GitHub Action.
The Deploy Course Action is a composite GitHub Action that automates the deployment of educational courses to the qBraid platform. This guide helps AI agents understand how to programmatically interact with and use this action.
- Repository:
qBraid/upload-course-action - Latest Version:
@v0.1.0-beta(beta),@mainfor development
| Input | Type | Description | Example |
|---|---|---|---|
api-key |
string | qBraid API key (must be stored in GitHub secrets) | ${{ secrets.QBRAID_API_KEY }} |
repo-read-token |
string | GitHub token with read access to repository | ${{ secrets.GITHUB_TOKEN }} |
| Input | Type | Default | Description |
|---|---|---|---|
course-json-path |
string | course.json |
Path to course configuration file |
article-type |
string | course |
Type of article (course or blog) |
force-duplicate-questions |
string | false |
Force upload duplicate questions (true or false) |
draft |
string | false |
Create draft course (true or false) |
| Output | Description |
|---|---|
course_name |
Name of the deployed course |
course-custom-id |
Custom ID of the deployed course |
qbook_url |
URL of the deployed course on qBraid |
name: Deploy Course
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Deploy to qBraid
id: deploy
uses: qBraid/upload-course-action@v0.1.0-beta
with:
api-key: ${{ secrets.QBRAID_API_KEY }}
repo-read-token: ${{ secrets.GITHUB_TOKEN }}
- name: Use deployment outputs
run: |
echo "Course: ${{ steps.deploy.outputs.course_name }}"
echo "URL: ${{ steps.deploy.outputs.qbook_url }}"Before an agent can use this action, ensure:
- course.json exists: The repository must contain a valid
course.jsonfile in the root (or at the path specified bycourse-json-path) - API Key configured:
QBRAID_API_KEYmust be set in repository secrets - Permissions enabled: Repository must have "Read and write permissions" enabled in Settings > Actions > General > Workflow permissions
Agents should validate or generate course.json with the following structure:
{
"courseName": "Course Name",
"courseDescription": "Course description",
"visibility": "public",
"imageLink": {
"darkLogo": "https://example.com/dark-logo.jpg",
"lightLogo": "https://example.com/light-logo.jpg"
},
"tags": ["tag1", "tag2"],
"deployedTo": ["qbraid.com"],
"content": [
{
"chapterName": "Chapter Name",
"chapterNumber": 1,
"baseFilePath": "./path/to/notebook.ipynb",
"kernelName": "python3",
"kernelId": "Python 3",
"sections": []
}
]
}- Notebooks: Must exist at paths specified in
course.json, max 5MB each - Images: Referenced images must exist and be under 1MB
- Security: Notebooks are scanned for XSS, script injection, and credential exposure
Before triggering the action, agents should:
- Check for
course.jsonexistence - Validate JSON structure
- Verify all referenced notebook files exist
- Check image file existence and sizes
Agents can trigger deployment by:
- Push to branch: Commit changes and push to trigger workflow
- Workflow dispatch: Use GitHub API to trigger
workflow_dispatchevent - Pull request: Create PR that triggers workflow (if configured)
The action performs these stages automatically:
- Stage 0: Validate API Key
- Stage 1: Validate course.json structure
- Stage 2: Verify all notebooks exist
- Stage 3: Check image references
- Stage 5: Create course via qBraid API
- Stage 6: Poll for completion
Agents should:
- Check workflow run status
- Extract outputs from action steps
- Handle success/failure notifications
- Store
qbook_urlfor future reference
-
API Key Invalid: Action fails at Stage 0
- Solution: Verify
QBRAID_API_KEYsecret is correct
- Solution: Verify
-
course.json Invalid: Action fails at Stage 1
- Solution: Validate JSON structure and required fields
-
Notebook Missing: Action fails at Stage 2
- Solution: Ensure all
baseFilePathvalues point to existing files
- Solution: Ensure all
-
Image Missing/Too Large: Action fails at Stage 3
- Solution: Verify image paths and ensure files are < 1MB
-
API Error: Action fails at Stage 5
- Solution: Check API key permissions and qBraid API status
Agents can detect errors by:
- Monitoring workflow run status
- Checking action step exit codes
- Parsing error messages from action logs
- Reviewing commit comments (action posts failure notifications)
Agents can interact with this action via GitHub API:
# Example: Trigger workflow dispatch
import requests
headers = {
"Authorization": f"token {github_token}",
"Accept": "application/vnd.github.v3+json"
}
response = requests.post(
f"https://api.github.com/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",
headers=headers,
json={"ref": "main"}
)After workflow completion, agents can retrieve outputs:
# Get workflow run
run = github.get_repo(f"{owner}/{repo}").get_workflow_run(run_id)
# Parse job logs to extract outputs
# Outputs are available via step outputs in subsequent steps- Validate Before Deploying: Always validate
course.jsonand file structure before triggering deployment - Handle Secrets Securely: Never expose API keys or tokens in code or logs
- Monitor Workflow Status: Poll workflow run status to detect completion
- Error Recovery: Implement retry logic for transient failures
- Idempotency: Ensure deployments are idempotent (can be safely repeated)
- Logging: Log all deployment attempts and results for debugging
Agents can test the action using:
- Local testing: Use
acttool with test workflows inexamples/directory - Test workflows: See
examples/test-workflow-*.ymlfor reference - Dry-run validation: Run validation scripts independently before full deployment
- API keys must be stored in GitHub secrets, never in code
- Repository tokens should have minimal required permissions
- Content is scanned for security vulnerabilities before deployment
- File size limits prevent resource exhaustion attacks
- README.md: User-facing documentation
- WORKFLOW_GUIDE.md: Detailed workflow usage guide
- DEVELOPMENT.md: Development and contribution guide
- TESTING.md: Testing procedures and guidelines
For issues or questions:
- Open an issue in this repository
- Review existing documentation files
- Check workflow logs for detailed error messages