🤖 Unraid Template Automation - Separate Repository Setup
This guide is for maintaining your Unraid template in a separate repository (the common pattern used by many developers).
📋 Repository Structure
Two Repositories:
dopeytree/TVx- Your main application repositorydopeytree/unraid-templates- Your Unraid templates repository
🔧 Setup Required
Step 1: Create Personal Access Token (PAT)
The workflow needs permission to push to your unraid-templates repository.
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Or direct link: https://github.com/settings/tokens
-
Click Generate new token → Generate new token (classic)
- Configure the token:
- Note:
Unraid Templates Automation - Expiration:
No expiration(or 1 year) - Scopes: Select:
- ✅
repo(Full control of private repositories) - ✅
workflow(Update GitHub Action workflows)
- ✅
- Note:
-
Click Generate token
- COPY THE TOKEN NOW - You won’t see it again!
Step 2: Add Token to TVx Repository Secrets
- Go to your TVx repository settings:
-
Click New repository secret
- Configure:
- Name:
PAT_UNRAID_TEMPLATES - Value: Paste the token you copied
- Click Add secret
- Name:
Step 3: Create/Verify unraid-templates Repository
If you don’t have it yet:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Create the repository on GitHub first, then:
git clone https://github.com/dopeytree/unraid-templates.git
cd unraid-templates
# Add a README
echo "# Unraid Templates
Docker templates for Unraid Community Applications.
Maintained by dopeytree.
" > README.md
git add README.md
git commit -m "Initial commit"
git push
Step 4: Add Workflow to TVx Repository
The workflow file has been created at:
.github/workflows/update-unraid-template-remote.yml
Commit and push it:
1
2
3
4
5
cd /Users/ed/TVx
git add .github/workflows/update-unraid-template-remote.yml
git commit -m "🤖 Add workflow to update template in separate repo"
git push
🚀 How It Works
On Every Release:
- Workflow triggers when you create a release in TVx
- Checks out both repos:
- Your TVx repository
- Your unraid-templates repository
- Updates template:
- Copies
tvx-unraid-template.xml→unraid-templates/tvx.xml - Updates
<Date>tag - Updates
<Changes>from release notes
- Copies
- Commits to unraid-templates:
- Pushes updated
tvx.xmlto unraid-templates repo
- Pushes updated
- Optionally syncs back:
- Updates local
tvx-unraid-template.xmlin TVx repo
- Updates local
📝 Template URL Update
Update your template’s <TemplateURL> to point to the separate repo:
1
<TemplateURL>https://raw.githubusercontent.com/dopeytree/unraid-templates/main/tvx.xml</TemplateURL>
Instead of:
1
<TemplateURL>https://raw.githubusercontent.com/dopeytree/TVx/main/tvx-unraid-template.xml</TemplateURL>
🎯 Repository Patterns
Pattern 1: Separate Repo (Recommended)
Structure:
1
2
3
4
5
6
7
8
dopeytree/TVx/
├── tvx-unraid-template.xml (development copy)
└── .github/workflows/update-unraid-template-remote.yml
dopeytree/unraid-templates/
├── tvx.xml (published template)
├── other-app.xml
└── README.md
Pros:
- ✅ Clean separation of concerns
- ✅ Multiple apps in one templates repo
- ✅ Easy for Community Apps to track
- ✅ Standard pattern used by most developers
Cons:
- ⚠️ Requires PAT setup
- ⚠️ Two repos to manage
Pattern 2: Same Repo
Structure:
1
2
3
dopeytree/TVx/
├── tvx-unraid-template.xml
└── .github/workflows/update-unraid-template.yml
Pros:
- ✅ Simpler setup
- ✅ Everything in one place
- ✅ No PAT needed
Cons:
- ⚠️ Template mixed with application code
- ⚠️ Harder if you have multiple apps
🔄 Workflow Comparison
Separate Repo Workflow
File: .github/workflows/update-unraid-template-remote.yml
What it does:
- Checkout TVx repo
- Checkout unraid-templates repo (using PAT)
- Copy template between repos
- Update template
- Push to unraid-templates
- Optionally sync back to TVx
Same Repo Workflow
File: .github/workflows/update-unraid-template.yml
What it does:
- Checkout TVx repo
- Update template in place
- Push to TVx
🧪 Testing
Test the Separate Repo Workflow
-
Create a test release in TVx:
1 2 3 4
gh release create v1.0.1-test \ --title "Test Separate Repo Automation" \ --notes "Testing automatic template update to separate repo" \ --prerelease
- Watch the workflow:
- TVx Actions: https://github.com/dopeytree/TVx/actions
- Look for “Update Unraid Template (Separate Repo)”
- Verify in unraid-templates:
- Check: https://github.com/dopeytree/unraid-templates
- Look for automated commit
- Check
tvx.xmlwas updated
- Check TVx was synced:
- Pull latest:
git pull - Check
tvx-unraid-template.xmlwas also updated
- Pull latest:
⚙️ Configuration Options
Change Template Filename
If you want a different filename in unraid-templates:
1
2
3
4
# In update-unraid-template-remote.yml
- name: Copy template to unraid-templates repo
run: |
cp tvx/tvx-unraid-template.xml unraid-templates/your-name.xml
Disable Local Sync
If you don’t want to sync back to TVx repo, comment out this step:
1
2
3
4
# - name: Also update local template (optional)
# working-directory: tvx
# run: |
# ...
Different Branch
If your unraid-templates uses a different branch:
1
2
3
4
5
6
7
- name: Checkout unraid-templates repository
uses: actions/checkout@v4
with:
repository: dopeytree/unraid-templates
ref: master # or whatever branch you use
token: $
path: unraid-templates
🐛 Troubleshooting
Error: “Could not resolve to a Repository”
Problem: PAT secret not set or incorrect repository name
Fix:
- Verify secret exists: Settings → Secrets → Actions
- Check repository name in workflow matches yours
- Regenerate PAT if needed
Error: “Authentication failed”
Problem: PAT doesn’t have correct permissions
Fix:
- Go to https://github.com/settings/tokens
- Find your token
- Edit and ensure
repoandworkflowscopes are checked - Update secret in TVx repository
Error: “refusing to allow a Personal Access Token”
Problem: Fine-grained PAT instead of Classic PAT
Fix:
- Use Classic PAT, not Fine-grained
- Or configure fine-grained PAT with correct repository permissions
Template Not Pushed to unraid-templates
Check:
1
2
3
# View workflow logs
gh run list --repo dopeytree/TVx --workflow="Update Unraid Template (Separate Repo)"
gh run view --repo dopeytree/TVx --log
Common causes:
- PAT expired
- Wrong repository name
- Wrong branch name
- Repository doesn’t exist
📚 Which Workflow Should I Use?
Use Separate Repo If:
- ✅ You have multiple Unraid apps
- ✅ You want clean separation
- ✅ You follow standard Unraid developer patterns
- ✅ You’re okay with PAT setup
→ Use: .github/workflows/update-unraid-template-remote.yml
Use Same Repo If:
- ✅ You only have one app
- ✅ You want simpler setup
- ✅ You don’t mind template in app repo
→ Use: .github/workflows/update-unraid-template.yml
🎯 Recommended: Separate Repo
Most established Unraid developers use the separate repository pattern because:
- Scalability - Easy to add more apps
- Organization - Clean separation of concerns
- Community Apps - Easier for CA to track one templates repo
- Best Practice - Industry standard pattern
✅ Setup Checklist
- Created PAT with
repoandworkflowscopes - Added PAT as secret
PAT_UNRAID_TEMPLATESin TVx repo - Created/verified unraid-templates repository exists
- Added workflow file to TVx repository
- Updated
<TemplateURL>in template to point to separate repo - Tested with a pre-release
- Verified template updated in unraid-templates repo
- Verified local template synced back (if enabled)
🎉 You’re Done!
Your Unraid template will now automatically update in your separate templates repository whenever you create a release!
Need Help?
- 📖 Read:
docs/AUTOMATION.md - 💬 Ask: Unraid Forum
- 🐛 Report: GitHub Issues